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
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…
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!
@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.
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.