Reputation: 3680
Is it necessary to have multiple PHP-FPM pools for only one APP? I have an App with Digital Ocean, Drupal, NGINX, 2 cores, 2 Gigas of RAM. Using Perusio's config for NGINX & DRUPAL my current configuration have 3 pools, and I don't know if it's good for perfomance to have multiple pools or if I can run my Drupal App from one pool only.
Why I wan't to run PHP-FPM only from one pool? Because there are some parameters in PHP-FPM configuration for every pool that must be set depending on the CPU cores, RAM, etc... but what if have 2 or 3 pools? Should I divide everything by 3? Then these settings becomes confusing.
Also the logs for every pool (access, error) are detached and I prefer all in one location. I've read that with different pools we can control different apps, and sounds logic, but it's not my case.
I'm already in production, that's what I'm asking if there are no problems without testing first by myself. Thanks to all!
Upvotes: -1
Views: 1446
Reputation: 1471
Pools are designed to give granular configuration and control over PHP-FPM; each running pool can have distinct behaviour. For this reason, many choose to have a single PHP-FPM pool per application.
If I have understood your question, you are running three pools with only a single Drupal installation. If this is the case and all three configurations are identical, then this can be simplified by merging into a single pool.
My recommendations:
As you are already in production, observe all the pm
settings (especially if pm = dynamic
) and ensure that you increase settings like pm.max_children
proportionally the number of pools you are removing (e.g., if pm.max_children = 10
I would recommend raising this to 30 to accommodate).
If your PHP-FPM instances are using caches, ensure that these are flushed.
Keep a complete hot backup of your configuration files (e.g., the whole of /etc/php-fpm.d) and make liberal use of PHP-FPM's reload capability instead of restarting if you want to minimise downtime.
Ensure that Nginx's fastcgi_pass
is adjusted to point to the right socket / port.
Finally, keep an eye on the number of processes being spawned and memory consumed. A misconfiguration in pm
can easily allow PHP-FPM to consume too many resources. Good luck!
Upvotes: 3