Hi folks -- <div><br></div><div>I apologize in advance, as this isn&#39;t necessarily a clear-cut Nginx issue per se, but I&#39;d appreciate any pointers that anyone might have.</div><div><br></div><div>I&#39;m transitioning a web site with app servers currently running FreeBSD/Apache/mod_php into a new setup where they will run nginx+php-fpm. I have been testing with a machine that is running FreeBSD 7.1-Release, nginx/0.7.60, PHP 5.2.8/fpm-0.5.10.  It&#39;s a dual quad-core (Xeon 5405) with 12GB.</div>
<div><br></div><div>I offloaded some live traffic from our app servers to this test server to see how it performed, gradually increasing the load.  We got to around 250 reqs/s (measured using the nginx stub status module -- and it&#39;s purely dynamic traffic -- static stuff is served separately) with no strain on the server (avg load on procs was &lt; 1, no disk blocking in vmstat, etc.).</div>
<div><br></div><div>As soon as we passed the 250 req/s mark, we witnessed an instant slowdown.  On the nginx status page, &quot;Writing: &quot; jumps from approx. 15-20 to over 2000 (continuing to pile up rapidly).  However, server load stays constant and I didn&#39;t notice significant I/O changes (in vmstat/iostat) -- but maybe I missed something.  Likewise, kern.openfiles rose to maybe ~ 2000 (well below the limit) and kern.ipc.numopensockets was similar.</div>
<div><div><br></div></div><div>This occurs if we keep the load constant at around 200 reqs/s, just not as fast -- after a couple of hours, though, the same thing happens -- and traffic just piles up.  The only way we can resolve it is to restart nginx / php-fpm and decrease the traffic load sent to the server.</div>
<div><br></div><div>This is what my /boot/loader.conf looks like:</div><div><div>kern.maxdsiz=&quot;11264M&quot;</div><div>kern.dfldsiz=&quot;768M&quot;</div><div>kern.maxssiz=&quot;256MB&quot;</div><div>vm.kmem_size=&quot;1400M&quot;<br>
</div><div>kern.maxbcache=&quot;64M&quot;<br></div><div>kern.ipc.maxpipekva=&quot;4M&quot;<br></div><div>kern.maxfiles=&quot;65536&quot;<br></div><div>kern.ipc.nmbclusters=&quot;65536&quot;<br></div><div><br></div><div>And /etc/sysctl.conf contains:</div>
<div><div>kern.ipc.somaxconn=8192</div><div>kern.ipc.nmbclusters=32768</div><div><br></div><div>In php-fpm.conf I&#39;ve got rlimit_files set to 30000 and max_children to 200.</div><div><br></div><div>Does anyone have any advice on how to further investigate this issue?  I would expect the load on the server to gradually increase, not pile up like this, so I assume some system or software configuration value must be holding this back.  </div>
<div><br></div><div>Thanks!</div><div><br></div><div>Antonio</div></div></div>