atom feed20 messages in ru.sysoev.nginxRe: Nginx + php-fpm "504 Gateway Time...
FromSent OnAttachments
rahul286Sep 6, 2010 10:38 pm 
Rahul BansalSep 6, 2010 11:27 pm 
Rahul BansalSep 6, 2010 11:27 pm 
Igor SysoevSep 6, 2010 11:31 pm 
Rahul BansalSep 6, 2010 11:40 pm 
Igor SysoevSep 6, 2010 11:46 pm 
Reinis RozitisSep 7, 2010 3:33 am 
Rahul BansalSep 7, 2010 9:03 am 
Reinis RozitisSep 7, 2010 9:56 am 
minaevSep 8, 2010 2:47 am 
Jérôme LoyetSep 8, 2010 2:54 am 
rahul286Sep 8, 2010 2:58 am 
minaevSep 8, 2010 3:29 am 
rahul286Sep 8, 2010 3:32 am 
Rahul BansalSep 8, 2010 4:01 am 
minaevSep 8, 2010 4:15 am 
Reinis RozitisSep 8, 2010 4:18 am 
Jérôme LoyetSep 8, 2010 5:16 am 
Michael ShadleSep 8, 2010 10:20 am 
net999Apr 14, 2011 1:13 pm 
Subject:Re: Nginx + php-fpm "504 Gateway Time-out" error with almost zero load (on a test-server)
From:Jérôme Loyet (jer@loyet.net)
Date:Sep 8, 2010 2:54:02 am
List:ru.sysoev.nginx

2010/9/8 minaev <ngin@nginx.us>:

Rahul,

I have the same problem and I think I, probably, know what's causing it. The bad thing is that I got it trying to solve another one and I don't know how to fix both :)

So, until today, my server sometimes issued 504 error. The error log reported "upstream timed out (110: Connection timed out) while reading response header from upstream" error. Trying to fix it, I played with various PHP-FPM timeouts. So, I increased pm.max_children from 5 to 10 and set request_terminate_timeout to 30s. Immediately after these changes had been  made, 504 error was gone, but now I receive 502 with the same diagnostics as yours: "Connection reset by peer".

Do you have request_terminate_timeout defined in your php-fpm.conf?

you have too many connections and FPM is not able to handle everything. You can play with backlog, max_client and timeouts.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,127854,128331#msg-128331