<div dir="ltr">Thanks, my math is not wrong my concept about php-fpm was wrong. I was thinking each child can handle 40000 requests/sec. :(<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 22, 2014 at 7:52 PM, Reinis Rozitis <span dir="ltr"><<a href="mailto:r@roze.lv" target="_blank">r@roze.lv</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
pm.max_children = 250<br>
pm.start_servers = 40<br></div>
pm.max_requests = 40000<br>
</blockquote><div class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any clue why requests are still getting into php-fpm queue and max children also reached errors occuring, even max_children are 250 * 40000. ??<br>
</blockquote>
<br>
<br></div>
Your math is wrong - there is no such 250 * 40000, because pm.max_requests is just a number of requests after which the php child restarts (to avoid possible memory leak etc (it may also be 0)).<br>
<br>
Your (maximum simultaneously running) concurrent requests are still 250 (~pm.max_children), so bassically if your request takes longer than 1 second and there are more than 250 requests per second you will end up with a queue.<br>
<br>
<br>
You either speed up the php code (and everything besides it) / increase the FPM pool (more children or more pools/fpm backends) or use caching like some frontend cache (varnish/squid etc) or nginx with fastcgi_cache.<span class="HOEnZb"><font color="#888888"><br>
<br>
rr</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/<u></u>mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>