1

When reading the article on the link below, I had some doubts, I will explain my scenario and talk about my doubt.

https://dzone.com/articles/upstream-php-fpm-for-better-performance-1

I currently have a 32 GB memory server, of which I left 20 GB for PHP-FPM. I have a www.conf file, and I am using the "ondemand" method, the average consumption of my PHP-FPM pools is 29 MB, so my pm.max_children is equal to 690, my pm.process_idle_timeout is 15s, and my pm.max_requests is equal to 1000.

Is it worth it to create another www2.conf, calculate 10 GB of memory for each one, and do the "load balance" of the requests that are entering using the upstream of nginx? Can this increase the performance and redundancy of my sites?

Lucas Lima
  • 113
  • 4
  • 1
    I can't directly answer your question and I'm not a PHP expert, but I suspect trying to load balancer across pools isn't going to help much. I only use different pools when I need different settings for a particular application or to keep things separated for security. – Tim Jan 25 '21 at 19:26
  • I'm finishing doing the tests here, and I really saw no difference. – Lucas Lima Jan 25 '21 at 20:36

1 Answers1

2

The linked article is from year 2016 and seems to be referring to PHP5.

PHP has taken big steps forward since that and most likely the article is invalid for current PHP versions.

I personally doubt that any such tuning would be beneficial.

However, I don't have any real-world experience on such a setup. I recommend you to test both setups with your workload and see if there is any benefit.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • Unfortunately I have a legacy system that still uses PHP5, but I will test both configurations, if I don't see any gains, I leave it as it is currently, with a pool. – Lucas Lima Jan 25 '21 at 18:51