|Niro||Jan 12, 2010 10:05 am|
|merlin corey||Jan 12, 2010 4:45 pm|
|war59312||Feb 11, 2010 8:12 pm|
|Daniel Hahler||Feb 12, 2010 5:20 am|
|Reinis Rozitis||Feb 12, 2010 6:07 am|
|Piotr Karbowski||Feb 12, 2010 6:13 am|
|shaktale||Feb 12, 2010 10:29 am|
|Usu||Apr 3, 2010 7:23 pm|
|Payam Chychi||Apr 3, 2010 7:36 pm|
|jjjx128||Apr 3, 2010 8:08 pm|
|Usu||Apr 4, 2010 12:55 am|
|unclepieman||Apr 4, 2010 11:37 am|
|Usu||Apr 4, 2010 11:59 am|
|unclepieman||Apr 4, 2010 12:19 pm|
|Usu||Apr 4, 2010 12:21 pm|
|Don Burris||Jun 20, 2010 2:28 pm|
|franky gman||Aug 11, 2011 10:05 am|
|Volodymyr Kostyrko||Aug 11, 2011 10:25 am|
|Reinis Rozitis||Aug 12, 2011 4:31 am|
|Subject:||Re: Nginx + PHP FASTCGI FAILS - how to debug ?|
|From:||Daniel Hahler (gen...@thequod.de)|
|Date:||Feb 12, 2010 5:20:25 am|
I have an Ubuntu 9.10 server on AMAZON EC2 running Nginx +PHP with PHP FASTCGI
via port 9000.
The server runs fine for a few minutes and after a few minutes (several
thousands of hits in this case) FastCGI dies and Nginx returns 502 Error.
Nginx log shows 2010/01/12 16:49:24 1093#0: *9965 connect() failed (111:
Connection refused) while connecting to upstream, client: 188.8.131.52, server:
localhost, request: "GET /data.php?data=7781 HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "site1.mysite.com", referrer:
I've experiencing something similar. After some time (some hours, but I'm getting not that much hits), PHP appears to be not responding anymore: Processes are running, but nginx times out: First with upstream timed out (110: Connection timed out) while reading response header from upstream then recv() failed (104: Connection reset by peer) while reading response header from upstream
This happened with php-cgi and a custom start script a few days ago (same symptoms, have not checked logs carefully), and today after I've switched to using php-fpm.
So, both php-cgi and php-fpm appear to not behave well with nginx. Those problems never appeared using lighttpd (in the same container/machine), but are happening now since I have only PHP running in the container/machine and nginx (acting as first proxy in line) is directly forwarding to it.
Maybe this did not happen with lighttpd before, because it (and the php-cgi process) was regularly restarted, which is not the case currently.
I've found http://bugs.php.net/bug.php?id=39809
I'm running PHP 5.3.1-0.dotdeb.1 and nginx 0.8.33-0~ppa2.
I guess this is rather a PHP than an nginx problem, since restarting php-fpm fixes it.
For now, I've tried bumping the number of child processes, hoping that this will prevent the PHP processes entering the ignoring state.
Here's a munin graph from the PHP container (http://i.imgur.com/MHbNi.png) - the failing started with the increasing number of established network connection: those are probably the connections from nginx queuing up, without being answered.
How can I debug what is causing FastCGI to die ?
So in your case there aren't any php-cgi processes anymore? Have you checked the php error log?