What is PM.MAX_CHILDREN and PM.MAX_REQUESTS?
Matthew Barrera
Everything was fine till the afternoon. I don't know why but at afternoon my website suddenly goes down. It takes 2 hours to get it up and run. After getting it up I checked the ERROR Files and this is what I get: server reached pm.max_children setting (70), consider raising it
What is it? I try to find out about it on web but doesn't understand anything. What should I do to prevent this type of downtime.
pm.max_children = 70
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 35
pm.max_requests = 5000 2 Answers
It shows that the max_children limit has raised beyond the value that you have set up in the php-fpm config file.
max_children is the max process that php-fpm service can lauch if pm is set to dynamic or the number of threads started by php-fpm if pm is set to static.
max_requests is the max number of request can to attend by each php-fpm process.
checkout this link to solve some issues in your server. by the way. this post would be on serverfault.
pm.max_requests:
The number of requests each child process should execute before respawning. This can be useful to work around memory leaks in 3rd party libraries. For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. Default value: 0.
pm.max_children:
The number of child processes to be created when pm is set to static and the maximum number of child processes to be created when pm is set to dynamic. This option is mandatory.
This option sets the limit on the number of simultaneous requests that will be served. Equivalent to the ApacheMaxClients directive with mpm_prefork and to the PHP_FCGI_CHILDREN environment variable in the original PHP FastCGI.
2