Nginx + php-fpm "504 Gateway Time-out" error with almost zeroload(on a test-server)

Rahul Bansal rahul.bansal at rtcamp.com
Wed Sep 8 15:02:15 MSD 2010


Thanks Reinis.

request_terminate_timeout = 30s worked for me.

I also started using adaptive spawning mechanism.

What I am wondering about is:
-I have same config without "request_terminate_timeout = 60s" and it handles
around 20K page-views daily without any issues.
-Issue appeared all of a sudden, then just 2 days back a test-site with
200MB database was created and running smoothly with 100 other sites without
any problem.
-PHP-FPM debug really produced very less info which was not helpful at all.

On sidenote, why php error shows up in nginx error.log and not in php-fpm?

--
Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd.
Mobile: +91-9860501882 | Web: http://rtcamp.com/



On Tue, Sep 7, 2010 at 10:26 PM, Reinis Rozitis <r at roze.lv> wrote:

> First of all I just noticed this in your initial mail:
>
>
> 2010/09/06 22:09:40 [error] 12909#0: *1064 connect() failed (111:
> Connection refused) while connecting to upstream, client: 192.168.0.1,
> server: rahul286.rtcamp.info, request: "GET /favicon.ico HTTP/1.1",
> upstream: "fastcgi://127.0.0.1:9000", host: "rahul286.rtcamp.info"
>
> Have you by chance misconfigurated the nginx and passing also static files
> (in this case favicon.ico) to php backend??
>
>
>
>
>
>  Debugging php-fpm log was first thing I did.
>>
>
> And nothing in there?
>
>
>
>  I am using "log_level = debug"
>>
>
> Debug prolly will end up as too much information anyways where in general
> you just need to catch something like this to pinpoint the slow scripts (for
> example):
>
> Sep 07 18:51:01.536661 [NOTICE] [pool www] child 17460 exited with code 0
> after 5875.977592 seconds from start
> Sep 07 18:51:01.537240 [NOTICE] [pool www] child 18471 started
> Sep 07 19:12:26.791721 [WARNING] [pool www] child 18409, script
> '/data/web/root/index.php' executing too slow (5.103076 sec), logging
> Sep 07 19:12:26.791790 [NOTICE] child 18409 stopped for tracing
> Sep 07 19:12:26.791799 [NOTICE] about to trace 18409
> Sep 07 19:12:26.791932 [ERROR] ptrace(PEEKDATA) failed: Input/output error
> (5)
> Sep 07 19:12:26.791980 [NOTICE] finished trace of 18409
>
>
>
>
>  With my pathetic patchwork, as I am restarting php5-fpm every minute,
>> above kind of "blockage" is not getting created.
>>
>
> This is the job for FPM itself and no external tools / jobs should be
> needed.
>
> You could try (if not allready) the php-fpm adaptive spawning mechanism
> then in case there is overload situation (too few free php childs) you would
> see something like this in logs:
>
> Sep 05 23:31:44.601141 [WARNING] [pool www] seems busy (you may need to
> increase start_servers, or min/max_spare_servers), spawning 16 children,
> there are 4 idle, and 50 total children
> Sep 05 23:31:45.605144 [WARNING] [pool www] seems busy (you may need to
> increase start_servers, or min/max_spare_servers), spawning 32 children,
> there are 3 idle, and 51 total children
>
>
>
> rr
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100908/f7dc4156/attachment-0001.html>


More information about the nginx mailing list