PHP FPM: a project website frequently appears 503 problem solving (warning: [pool www] server reached pm.max)_ children setting (50), consi…

The service is nginx + PHP FPM configuration

After running for a period of time, it often appears as follows:

WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
The maximum number of child processes is reached and the number of child processes needs to be provided

503/502 is generally due to server maintenance or overload. Recently, the server has not been maintained. Querying the monitoring records, we found that the load is not very high. We speculated whether the server has restrictions on some configurations of the project. We checked the nginx and PHP logs and found that:

Find the php-fpm.conf file and find the PHP log error

[15-Nov-2017 15:23:51] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[15-Nov-2017 17:10:53] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[15-Nov-2017 17:12:56] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[15-Nov-2017 18:29:28] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[16-Nov-2017 10:25:17] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

the warning appears frequently, and the number of child processes reaches the maximum. Query the PHP FPM configuration file www.conf It is found that PM. Max_ Children use the default configuration, obviously because the setting value is too small

Problem solving:

Modification

pm.start_servers = 10   //Number of php-fpm start processes
pm.min_spare_servers = 10 //minimum number of idle processes for php-fpm
pm.max_spare_servers = 24 //maximum number of idle processes for php-fpm
pm.max_requests = 500 // restart time for all child processes

Similar Posts: