1 fcgi cannot work well but 5 fcgi process does.

Ed ed at bittmail.com
Mon Jan 5 15:06:33 MSK 2009

I believe you need at least 2 fcgi's running minimum. Because the fcgi
process is usually set to handle only a limited number of requests before
restarting itself. Thus if your ab benchmark exceeds the maximum number of
requests that your single php-fcgi is set to handle then the fcgi process
will restart in the middle of the benchmark most likely giving you a

If you have 2 running I think it will hand off the requests to the next
process. "though it may actually share the load between all the fcgi's I'm
unsure about this" I usually run 16 to 24 php-fcgi's and set the max request
per fcgi to 50 or less. That way they restart frequently and won't go wild
with ram usage. I've actually seen vps setups with max requests per child @
10 then runnning 25 or more php-fcgi processes. They kill themselvs off
before consuming any real ammount of ram. I'm unsure how well this would
work with a extremely busy site but the idea is interesting for sure.

Try running at least 2 php-fcgi's and set your max request's per child to
something like 50 - 250.

On Sun, Jan 4, 2009 at 12:25 PM, Denis Filimonov <denis at filimonov.name>wrote:

> It's simple math: if the time to generate your test page is bigger than
> timeout * number-of-fastcgi-processes/number-of-concurrent-requests you'll
> be
> getting timeouts. If you fix the number of processes and the concurrency
> the
> only variable to play with is the timeout.
> On Monday 29 December 2008 11:23:01 Miao Jiang wrote:
> > I use nginx/0.6.31+fastcgi to deploy ruby on rails.
> > then I use ab to do 'ab -n1000 -c500' for the pressure test.
> > when it only run with 1 fastcgi process.
> > It works well with ab -n1000 -c1 to -c100
> > but in -c500,after about 800 request, the response suddenly returns very
> > slowly even timeout. I use 'top' to see the process status, fcgi process
> > isn't busy any more.
> >
> > then I try add 4 more process, then it works well.
> > Can anyone could help me understand how it happens and how to setup
> > nginx let it could finish -c500 test with only 1 fcgi process.
> >
> > Thanks
> > Miao

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090105/bef8dfb9/attachment.html>

More information about the nginx mailing list