I believe you need at least 2 fcgi&#39;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 timeout.<br>
<br>If you have 2 running I think it will hand off the requests to the next process. &quot;though it may actually share the load between all the fcgi&#39;s I&#39;m unsure about this&quot; I usually run 16 to 24 php-fcgi&#39;s and set the max request per fcgi to 50 or less. That way they restart frequently and won&#39;t go wild with ram usage. I&#39;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&#39;m unsure how well this would work with a extremely busy site but the idea is interesting for sure.<br>
<br>Try running at least 2 php-fcgi&#39;s and set your max request&#39;s per child to something like 50 - 250. <br><br><div class="gmail_quote">On Sun, Jan 4, 2009 at 12:25 PM, Denis Filimonov <span dir="ltr">&lt;<a href="mailto:denis@filimonov.name">denis@filimonov.name</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It&#39;s simple math: if the time to generate your test page is bigger than<br>
timeout * number-of-fastcgi-processes/number-of-concurrent-requests you&#39;ll be<br>
getting timeouts. If you fix the number of processes and the concurrency the<br>
only variable to play with is the timeout.<br>
<br>
On Monday 29 December 2008 11:23:01 Miao Jiang wrote:<br>
&gt; I use nginx/0.6.31+fastcgi to deploy ruby on rails.<br>
&gt; then I use ab to do &#39;ab -n1000 -c500&#39; for the pressure test.<br>
&gt; when it only run with 1 fastcgi process.<br>
&gt; It works well with ab -n1000 -c1 to -c100<br>
&gt; but in -c500,after about 800 request, the response suddenly returns very<br>
&gt; slowly even timeout. I use &#39;top&#39; to see the process status, fcgi process<br>
&gt; isn&#39;t busy any more.<br>
&gt;<br>
&gt; then I try add 4 more process, then it works well.<br>
&gt; Can anyone could help me understand how it happens and how to setup<br>
&gt; nginx let it could finish -c500 test with only 1 fcgi process.<br>
&gt;<br>
&gt; Thanks<br>
&gt; Miao<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>BiTTNews.com<br>