502 Bad Gateway - Nginx + PHP-FPM

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?

BTW, I realize this is not a support forum for PHP-FPM, but I know many
Nginx users also use PHP-FPM, so I figured this is one of the better
locations to get an intelligent response. If my post is completely not
wanted here, let me know :slight_smile:

All feedback appreciated!

Thanks!

Posted at Nginx Forum:

Found this in my logs:

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

Posted at Nginx Forum:

please post on http://groups.google.com/group/highload-php-en, I’ll
answer you.

++ jerome

2010/9/14 jlangevin [email protected]:

Done, awaiting moderation.

Posted at Nginx Forum:

So I went out to google groups and there seems to have been no
resolution to this issue.

I used the instructions found here to setup NGINX / PHP-FPM using the
dotdeb sources in Ubuntu:

I’m having tons of 502 errors randomly occur on requests. It’s really
bad – to figure out how to avoid this problem we set it up the same way
on another server – same issue.

The only workaround I can figure out is to set a cron job to manually
restart php-fpm every 5 minutes … I’d like to not have to do that.

Let me know if there’s some way of avoiding this issue…

Posted at Nginx Forum:

Discussion of this issue has moved here:
http://groups.google.com/group/highload-php-en/browse_thread/thread/d5ee42be6f8f775a

Posted at Nginx Forum:

Hehe – @jlangevin that’s great to know – I just started configuring a
new vm with Maverick just now – looking to see if native packages would
work better. Thanks!

Posted at Nginx Forum:

@supercleanse, Current Ubuntu 10.10 has native packages for PHP 5.3,
php-fpm (as php5-fpm), nginx, etc.
After these errors occurred for me, I upgraded my server to 10.10, and
installed all native packages. No further issues for me.

Posted at Nginx Forum:

@supercleanse, as you’re testing a new VM, here’s something else to test
out if you’re so inclined:
https://bitbucket.org/intel352/nginx-vhost/src

It’s a script for nginx that lets you fairly easily get a new vhost
ready. I created & use it for my own servers.
There’s other stuff out there that does this, but I haven’t seen
anything in native bash, usually perl or ruby/rails.

Cheers

Posted at Nginx Forum:

Thanks! That will definitely come in handy :slight_smile:

Posted at Nginx Forum: