Welcome! Log In Create A New Profile

Advanced

502 error on php-fpm

Posted by roguehosting 
502 error on php-fpm
October 22, 2009 06:27PM
For some reason php fpm sometime stops working,and nginx report 502 error after some time(first it looks like is entire server down,but it is actually just a timeout and 502 error will show if you leave enough).
First i though this is caused by firewall or it is some kind of corruption which can be fixed only by recompilation of php,but it seems it is not,seems it is some kind of overload beacuse when i was recompiling for second time there was no changes until sites started to appear itself.And it seems beacuse of that each time downtime was around 20 minutes.
I saw in google how this appear beacuse of error like timeout and connection reseted by peer in error log,and i did saw those errors in error log.And also i saw somewhere how adding line
FCGI_WEB_SERVER_ADDRS="127.0.0.1"
should eliminate those error plus that 502 error,but it doesn't say where to add that line.
Where to add that line and will that really work?I really cant afford any more downtimes.
Re: 502 error on php-fpm
October 22, 2009 06:34PM
that environment variable is useless when using php-fpm. there are no
environment variables when using php-fpm it's all controlled via the
config.

look at the php-fpm log. you may have some scripts taking too long
eating up too many resources, you can bump up the number of engines
for example.

if you try those things and it's still not obvious, pastebin your
config and send the link and we can examine it.

also what version of php-fpm and php?

On Thu, Oct 22, 2009 at 3:27 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> For some reason php fpm sometime stops working,and nginx report 502 error after some time(first it looks like is entire server down,but it is actually just a timeout and 502 error will show if you leave enough).
> First i though this is caused by firewall or it is some kind of corruption which can be fixed only by recompilation of php,but it seems it is not,seems it is some kind of overload beacuse when i was recompiling for second time there was no changes until sites started to appear itself.And it seems beacuse of that each time downtime was around 20 minutes.
> I saw in google how this appear beacuse of error like timeout and connection reseted by peer in error log,and i did saw those errors in error log.And also i saw somewhere how adding line
> FCGI_WEB_SERVER_ADDRS="127.0.0.1"
> should eliminate those error plus that 502 error,but it doesn't say where to add that line.
> Where to add that line and will that really work?I really cant afford any more downtimes.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16080#msg-16080
>
>
Re: 502 error on php-fpm
October 22, 2009 07:14PM
Here is link to conf file:
http://pastebin.com/m40e8a4cb
I checked log and i don't see anything unusual,mostly childs spawn repeating.Plus there is a lot of lines.
It is version of php 5.2.9 plus php-fpm version for that version(i noticed it have in title unofficial version)
Downloaded from here:
http://de.php.net/distributions/php-5.2.9.tar.gz
http://php-fpm.org/downloads/php-5.2.9-fpm-0.5.10-unofficial.diff.gz
Re: 502 error on php-fpm
October 22, 2009 07:20PM
why don't you use 5.2.11?

i guess paste your php-fpm log too. that config seems okay. maybe
increase the number of processes from 5 to 20? or something more than
5

On Thu, Oct 22, 2009 at 4:14 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> Here is link to conf file:
> http://pastebin.com/m40e8a4cb
> I checked log and i don't see anything unusual,mostly childs spawn repeating.Plus there is a lot of lines.
> It is version of php 5.2.9 plus php-fpm version for that version(i noticed it have in title unofficial version)
> Downloaded from here:
> http://de.php.net/distributions/php-5.2.9.tar.gz
>  http://php-fpm.org/downloads/php-5.2.9-fpm-0.5.10-unofficial.diff.gz
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16089#msg-16089
>
>
Re: 502 error on php-fpm
October 22, 2009 07:38PM
I think there was no 5.2.11 released yet when i was installing php,plus it didn't had support for zend optimizer and ioncube yet then,it have now.I tried to do make a log on pastebin but it seems it is toobig since browser crashes then
Re: 502 error on php-fpm
October 22, 2009 07:44PM
paste relevant chunks.

On Thu, Oct 22, 2009 at 4:38 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> I think there was no 5.2.11 released yet when i was installing php,plus it didn't had support for zend optimizer and ioncube yet then,it have now.I tried to do make a log on pastebin but it seems it is toobig since browser crashes then
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16095#msg-16095
>
>
Re: 502 error on php-fpm
October 22, 2009 07:54PM
Let me post first errors from nginx error log which showed during downtime i think:
2009/10/02 07:47:39 [error] 29013#0: *17250 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 87.188.52.228, server: domain.com, request: "GET /?x=8151.2747.4547. HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com"
2009/10/19 13:17:31 [error] 19779#0: *42779878 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 69.76.12.145, server: domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: domain.com refferer:refferedomain.com
Re: 502 error on php-fpm
October 22, 2009 07:58PM
i would increase the number of engines and then look at some php profiling

On Thu, Oct 22, 2009 at 4:54 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> Let me post first errors from nginx error log which showed during downtime i think:
> 2009/10/02 07:47:39  29013#0: *17250 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 87.188.52.228, server: domain.com, request: "GET /?x=8151.2747.4547. HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com"
> 2009/10/19 13:17:31  19779#0: *42779878 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 69.76.12.145, server: domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: domain.com refferer:refferedomain.com
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16102#msg-16102
>
>
Re: 502 error on php-fpm
October 22, 2009 08:01PM
Also i uploaded log here in zip archive:
http://www.2shared.com/file/8615809/b32fa2c3/php-fpm.html
Re: 502 error on php-fpm
October 22, 2009 08:08PM
i still say

1) bump up the number of engines from more than 5
2) turn on the timeout functionality so it logs when a script executes
for more than 3 or 4 seconds...



On Thu, Oct 22, 2009 at 5:01 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> Also i uploaded log here in zip archive:
> http://www.2shared.com/file/8615809/b32fa2c3/php-fpm.html
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16106#msg-16106
>
>
Re: 502 error on php-fpm
October 22, 2009 08:12PM
1)This value ? <value name="max_children">5</value>
2)And this value?
The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
<value name="request_slowlog_timeout">0s</value>
Re: 502 error on php-fpm
October 22, 2009 08:48PM
yeah. increase it so it isn't off and change the 5 to 20 or something

On Thu, Oct 22, 2009 at 5:12 PM, roguehosting <nginx-forum@nginx.us> wrote:
>
> 1)This value ? 5
> 2)And this value?
> The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
>                        '0s' means 'off'
>                        0s
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,16080,16108#msg-16108
>
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
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