This document explains the dependency issue between Apache and PHP-FPM child processes and the solution to ensure that PHP-FPM works effectively on your system.
This bottleneck and solution only applies to
Apache settings may limit the performance of your configured PHP-FPM pool options. You must configure the Apache server to handle the same or more amount of requests than the PHP-FPM server. The following example resembles a common configuration that Apache settings may limit:
- Domain is
pm_max_childrenpool options is set to
- Apache is set to
10(This is the default for cPanel installations).
Your configuration file may not contain Apache's default values. In this situation, if the system receives 20 requests, it immediately passes 5 to the FPM children. After the FPM children processes the requests, Apache passes the next 5 requests. You must adjust your Apache configuration to meet the requirements of a high traffic web server.
As you increase the requests for
pm_max_children in WHM's PHP-FPM's Pool Options interface (Home >> Software >> MultiPHP Manager), you must match or increase those requests in WHM's Apache Configuration (Home >> Service Configuration >> Apache Configuration). In Apache Configuration, under the Global Configurations tab, adjust the Start Servers option to use the same or greater value as the PHP-FPM
pm_max_children pool options.
For the example above, you would set the Start Servers option to
If you do not set these configurations correctly, Apache may not serve requests in a timely manner. For example, if
pm_max_children is set to
20 and Apache is set to
5, PHP-FPM and Apache can only serve 5 requests at a time. Apache abides by the lowest of the two settings.