Welcome! Log In Create A New Profile

Advanced

502 Bad Gateway - Nginx + PHP-FPM

Posted by intel352 
intel352
502 Bad Gateway - Nginx + PHP-FPM
September 14, 2010 05:14PM
I've noticed a curious issue recently on my server.

I am running Ubuntu 10.04, Nginx, and PHP-FPM using Brian Mercer
method.

I recently updated the server, and then also updated my PHP-FPM config
to allow dynamic child processes instead of just static.
I've noticed now that *one* of my domains (all my domains within the
same server and same worker group) will periodically hit a 502 Bad
Gateway error, which remains up for that domain, while other sub
domains and other websites hosted on my server, have no problem.

Restarting PHP-FPM resolves the issue.

What puzzles me is, why would it toss this error just for *one*
domain, not the rest?
I'm assuming this is actually not a problem in Nginx, but moreso in
PHP-FPM, regarding the number of processes, requests, etc?

Here's a sample of log output:
Sep 14 15:24:55.942487 [NOTICE] [pool www] child 29911 started
Sep 14 15:53:45.640790 [WARNING] [pool www] child 29908 exited on
signal 11 SIGSEGV after 1730.763352 seconds from start
Sep 14 15:53:45.644145 [NOTICE] [pool www] child 29980 started
Sep 14 16:15:51.861570 [WARNING] [pool www] child 29907 exited on
signal 11 SIGSEGV after 3057.712053 seconds from start
Sep 14 16:15:51.865127 [NOTICE] [pool www] child 30041 started


All feedback appreciated!

Thanks!
Jérôme Loyet
Re: 502 Bad Gateway - Nginx + PHP-FPM
September 14, 2010 05:38PM
2010/9/14 intel352 <intel352@gmail.com>:
> I've noticed a curious issue recently on my server.
>
> I am running Ubuntu 10.04, Nginx, and PHP-FPM using Brian Mercer
> method.
>
> I recently updated the server, and then also updated my PHP-FPM config
> to allow dynamic child processes instead of just static.
> I've noticed now that *one* of my domains (all my domains within the
> same server and same worker group) will periodically hit a 502 Bad
> Gateway error, which remains up for that domain, while other sub
> domains and other websites hosted on my server, have no problem.
>
> Restarting PHP-FPM resolves the issue.
>
> What puzzles me is, why would it toss this error just for *one*
> domain, not the rest?
> I'm assuming this is actually not a problem in Nginx, but moreso in
> PHP-FPM, regarding the number of processes, requests, etc?
>
> Here's a sample of log output:
> Sep 14 15:24:55.942487 [NOTICE] [pool www] child 29911 started
> Sep 14 15:53:45.640790 [WARNING] [pool www] child 29908 exited on
> signal 11 SIGSEGV after 1730.763352 seconds from start
> Sep 14 15:53:45.644145 [NOTICE] [pool www] child 29980 started
> Sep 14 16:15:51.861570 [WARNING] [pool www] child 29907 exited on
> signal 11 SIGSEGV after 3057.712053 seconds from start
> Sep 14 16:15:51.865127 [NOTICE] [pool www] child 30041 started
>
>

Is there more revelant logs ?

Do you know how to reproduce the problem ?

If you can, change log level to debug and get a core dump and send us
a backtrace.

You can maybe test the patch attached to the following bug report:
http://bugs.php.net/bug.php?id=52501
it should correct a bug which is maybe similar.

++ jerome


> All feedback appreciated!
>
> Thanks!
>
intel352
Re: 502 Bad Gateway - Nginx + PHP-FPM
September 14, 2010 07:06PM
Interesting bug report. I don't see any (recent) reports of mail
errors.
I've enabled the catch worker output setting, and enabled debug level
logs, so hopefully that will give better log information.

I've checked the PHP script's local error_log, as well as the website
Nginx log, and the server php5-fpm.log, nothing actually helpful in
any of the logs.

Hopefully whatever is causing this, will reoccur within the next 12-24
hours. Over the past 2 days, it's occurred each day, so it should re-
occur again by tomorrow.

Thanks!

On Sep 14, 5:36 pm, Jérôme Loyet <m...@fatbsd.com> wrote:
> 2010/9/14 intel352 <intel...@gmail.com>:
>
>
>
>
>
> > I've noticed a curious issue recently on my server.
>
> > I am running Ubuntu 10.04, Nginx, and PHP-FPM using Brian Mercer
> > method.
>
> > I recently updated the server, and then also updated my PHP-FPM config
> > to allow dynamic child processes instead of just static.
> > I've noticed now that *one* of my domains (all my domains within the
> > same server and same worker group) will periodically hit a 502 Bad
> > Gateway error, which remains up for that domain, while other sub
> > domains and other websites hosted on my server, have no problem.
>
> > Restarting PHP-FPM resolves the issue.
>
> > What puzzles me is, why would it toss this error just for *one*
> > domain, not the rest?
> > I'm assuming this is actually not a problem in Nginx, but moreso in
> > PHP-FPM, regarding the number of processes, requests, etc?
>
> > Here's a sample of log output:
> > Sep 14 15:24:55.942487 [NOTICE] [pool www] child 29911 started
> > Sep 14 15:53:45.640790 [WARNING] [pool www] child 29908 exited on
> > signal 11 SIGSEGV after 1730.763352 seconds from start
> > Sep 14 15:53:45.644145 [NOTICE] [pool www] child 29980 started
> > Sep 14 16:15:51.861570 [WARNING] [pool www] child 29907 exited on
> > signal 11 SIGSEGV after 3057.712053 seconds from start
> > Sep 14 16:15:51.865127 [NOTICE] [pool www] child 30041 started
>
> Is there more revelant logs ?
>
> Do you know how to reproduce the problem ?
>
> If you can, change log level to debug and get a core dump and send us
> a backtrace.
>
> You can maybe test the patch attached to the following bug report:http://bugs.php.net/bug.php?id=52501
> it should correct a bug which is maybe similar.
>
> ++ jerome
>
>
>
> > All feedback appreciated!
>
> > Thanks!
Jérôme Loyet
Re: 502 Bad Gateway - Nginx + PHP-FPM
September 15, 2010 02:24AM
2010/9/15 intel352 <intel352@gmail.com>:
> Interesting bug report. I don't see any (recent) reports of mail
> errors.
> I've enabled the catch worker output setting, and enabled debug level
> logs, so hopefully that will give better log information.
>
> I've checked the PHP script's local error_log, as well as the website
> Nginx log, and the server php5-fpm.log, nothing actually helpful in
> any of the logs.
>
> Hopefully whatever is causing this, will reoccur within the next 12-24
> hours. Over the past 2 days, it's occurred each day, so it should re-
> occur again by tomorrow.

does it happen every day at the same time ? Is there a cron or
something which reload FPM ?

>
> Thanks!
>
> On Sep 14, 5:36 pm, Jérôme Loyet <m...@fatbsd.com> wrote:
>> 2010/9/14 intel352 <intel...@gmail.com>:
>>
>>
>>
>>
>>
>> > I've noticed a curious issue recently on my server.
>>
>> > I am running Ubuntu 10.04, Nginx, and PHP-FPM using Brian Mercer
>> > method.
>>
>> > I recently updated the server, and then also updated my PHP-FPM config
>> > to allow dynamic child processes instead of just static.
>> > I've noticed now that *one* of my domains (all my domains within the
>> > same server and same worker group) will periodically hit a 502 Bad
>> > Gateway error, which remains up for that domain, while other sub
>> > domains and other websites hosted on my server, have no problem.
>>
>> > Restarting PHP-FPM resolves the issue.
>>
>> > What puzzles me is, why would it toss this error just for *one*
>> > domain, not the rest?
>> > I'm assuming this is actually not a problem in Nginx, but moreso in
>> > PHP-FPM, regarding the number of processes, requests, etc?
>>
>> > Here's a sample of log output:
>> > Sep 14 15:24:55.942487 [NOTICE] [pool www] child 29911 started
>> > Sep 14 15:53:45.640790 [WARNING] [pool www] child 29908 exited on
>> > signal 11 SIGSEGV after 1730.763352 seconds from start
>> > Sep 14 15:53:45.644145 [NOTICE] [pool www] child 29980 started
>> > Sep 14 16:15:51.861570 [WARNING] [pool www] child 29907 exited on
>> > signal 11 SIGSEGV after 3057.712053 seconds from start
>> > Sep 14 16:15:51.865127 [NOTICE] [pool www] child 30041 started
>>
>> Is there more revelant logs ?
>>
>> Do you know how to reproduce the problem ?
>>
>> If you can, change log level to debug and get a core dump and send us
>> a backtrace.
>>
>> You can maybe test the patch attached to the following bug report:http://bugs.php.net/bug.php?id=52501
>> it should correct a bug which is maybe similar.
>>
>> ++ jerome
>>
>>
>>
>> > All feedback appreciated!
>>
>> > Thanks!
>
Jonathan Langevin
Re: 502 Bad Gateway - Nginx + PHP-FPM
September 15, 2010 10:22AM
Dunno if it's occurring at a specific time, but.seems most common from
morning to noon. If any from exists, it's hourly.

Nothing reloading fpm.

It hasn't errored out yet today so far.

On Sep 15, 2010 2:22 AM, "Jérôme Loyet" <ml@fatbsd.com> wrote:

2010/9/15 intel352 <intel352@gmail.com>:

> Interesting bug report. I don't see any (recent) reports of mail
> errors.
> I've enabled the catc...
does it happen every day at the same time ? Is there a cron or
something which reload FPM ?


>
> Thanks!
>
> On Sep 14, 5:36 pm, Jérôme Loyet <m...@fatbsd.com> wrote:
>> 2010/9/14 intel352 <in...
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 339
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready