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

Michael Shadle mike503 at
Wed Sep 8 21:21:34 MSD 2010

On Wed, Sep 8, 2010 at 4:02 AM, Rahul Bansal <rahul.bansal at> wrote:

> -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?

502 will be when nginx's connection is broken to the upstream (it was
forcibly killed by request_terminate_timeout, etc.) - it's bad

504 is when nginx is waiting around and hits fastcgi_read_timeout or
other upstream related settings - it's a gateway timeout.

This isn't a "php error" per-se. nginx is logging the proxy related
issue, php-fpm just isn't logging "backlog too full" type of messages
(which it may or may not be able to do. No clue about that)

I've found the newer php-fpm to have plenty of error log output to
play with. This may be a lower level kernel related thing that php-fpm
is not aware of because the requests have been queued up and fill
up/timeout/drop before php-fpm even knows about them. (Just a hunch)

More information about the nginx mailing list