Welcome! Log In Create A New Profile

Advanced

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

Reinis Rozitis
September 07, 2010 01:00PM
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@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Re: Nginx + php-fpm "504 Gateway Time-out" error with almost zero load(on a test-server)

Reinis Rozitis September 07, 2010 06:40AM

Re: Nginx + php-fpm "504 Gateway Time-out" error with almost zero load(on a test-server)

Rahul Bansal September 07, 2010 12:08PM

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

Reinis Rozitis September 07, 2010 01:00PM

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

Rahul Bansal September 08, 2010 07:12AM

Re: Nginx + php-fpm "504 Gateway Time-out" error with almostzeroload(on a test-server)

Reinis Rozitis September 08, 2010 07:22AM

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

mike September 08, 2010 01:26PM

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

net999 April 14, 2011 04:13PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 213
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready