Currently I have a cron that restarts PHP-FASTCGI every 15 minutes but.....yea. 64 bit - Debian 5 nginx 0.6.32

  • It'll help if you could provide some details on the problem - is it a cpu hang, disk hang, network hang, etc... are you running in a VM or real machine? More info please. – sybreon Apr 19 '11 at 7:06
  • 1
    Exactly what does "but.....yea" mean? It's not a technical term I'm familiar with. – John Gardeniers Apr 19 '11 at 8:05

Use PHP-FPM instead of standard FastCGI. FPM works great with nginx.


try to install apache as backend for nginx php cgi. this solution is widly spread.


In addition to vartecs advice;

1) upgrade your nginx, 0.6.x is pretty old.

2) once php-fpm, configure /status and /ping to monitor it.

3) You might want to use nginx HttpStubStatusModul.

4) Something I've read on lightys wiki:

"This problem seems to stem from a little-known issue with PHP: PHP stops accepting new FastCGI connections after handling 500 requests; unfortunately, there is a potential race condition during the PHP cleanup code in which PHP can be shutting down but still have the socket open, so lighty can send request number 501 to PHP and have it "accepted", but then PHP appears to simply exit, causing a 500 return from lighty.

To limit this occurance, set PHP_FCGI_MAX_REQUESTS to 500."

5) If nothing helps, you might want to play with php.ini's max execution time and php-fpm's debug + slowlog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.