views:

321

answers:

1

I recently setup a new ubuntu machine, with wordpress, spawn-fcgi and nginx.

Every morning, I'd try to see my blog and I got a 502 error Bad Gateway error.

I tried finding some kind of log of why php-cgi died but couldn't find anything.

I run spawn-fcgi like so:

sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

I just did the following test:

ran the spawn-fcgi command, then sieged it.

After around 480 connections, spawn-fcgi died and I started getting 502 errors.

Any idea why this would happen, where I could find some kind of logs?

A: 

This might not be real fix, but setting PHP_FCGI_MAX_REQUESTS=400 environment variable will force php to kill itself after 400 requests and being reexecuted, so the problem won't appear.

Michal Čihař