How to automatically resume php-fpm?

Posted by alfish on Server Fault See other posts from Server Fault or by alfish
Published on 2012-06-17T21:34:59Z Indexed on 2012/06/18 21:18 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

I am using nginx+php-fpm on Debian Squeeze for a busy server and have had great difficulty to deal with maximum connections being reached. Here the problem is that php processes sometimes just die randomly under high load and leave the server with no php process. Then I need to manually restart php5-fpm service to bring back the server to life.

I am wondering how to avoid this to happen, or at least treat the symptoms by restarting the php5-fpm automatically whenever there is not php process left to listen to incoming requests. My relevant configs are:

pm = dynamic
pm.max_children = 1400

pm.start_servers = 10
pm.max_spare_servers = 20
pm.process_idle_timeout = 1s; #not sure it will be useful when pm=dynamic
pm.max_requests = 100000
request_terminate_timeout = 30

I appreciate your suggestions to cope with this nasty problem.

© Server Fault or respective owner

Related posts about debian

Related posts about monitoring