You're issue is probably not with php-fpm. Without knowing more about your architecture, these are key points you should look at:<div><br></div><div>1. What is your PHP code doing? What is it waiting for? Tools: xdebug (<a href="http://www.xdebug.org/">http://www.xdebug.org/</a>) and you could even try tracking it via the php-fpm slow log configuration option:</div>
<div><ul style="line-height: 1.5em; list-style-type: square; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://php-fpm.org/mediawiki/skins/monobook/bullet.gif); font-family: sans-serif; font-size: 13px; ">
<li style="margin-bottom: 0.1em; ">request_slowlog_timeout - The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file. Default: "5s". Note: '0s' means 'off'</li>
<li style="margin-bottom: 0.1em; ">slowlog - The log file for slow requests.</li></ul><div><br></div><div>2. How is your database performing? Are there issues with queries? again, look at the slow log query output of mysql. Look at connection issues and name resolution with mysql (its notoriously bad at host name resolution).</div>
<div><br></div><div>3. If your site is really busy, you may need to add more PHP application servers to handle the load.</div><div><br></div><div>Again, this is not a Nginx or PHP-FPM problem per se.</div><div><br></div><br>
<div class="gmail_quote">2010/10/26 Xin Liu <span dir="ltr"><<a href="mailto:liuxin84@gmail.com">liuxin84@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="ZH-CN" link="blue" vlink="purple"><div><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Even I set the pm.max_children=50, I still got lots of errors…...</span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New""> </span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Oct 26 22:09:36.354159 [WARNING] [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 8 children, there are 0 idle, and 12 total children</span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Oct 26 22:09:37.354215 [WARNING] [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 16 children, there are 0 idle, and 17 total children</span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Oct 26 22:11:20.650232 [WARNING] [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 8 children, there are 1 idle, and 17 total children</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New"">Oct 26 22:11:41.246244 [WARNING] [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 16 children, there are 0 idle, and 21 total children</span><span lang="EN-US" style="font-size:10.5pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:SimSun">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:10.0pt;font-family:SimSun"> Phil Bayfield [mailto:<a href="mailto:phil@techlightenment.com" target="_blank">phil@techlightenment.com</a>] <br>
</span><b><span style="font-size:10.0pt;font-family:SimSun">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:10.0pt;font-family:SimSun"> 2010</span><span style="font-size:10.0pt;font-family:SimSun">年<span lang="EN-US">10</span>月<span lang="EN-US">26</span>日<span lang="EN-US"> 19:07<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br></span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: server performance issue</span></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Your formulas look interesting, will give them a try next time I'm doing some optimising.</span></p><div><p class="MsoNormal">
<span lang="EN-US">Normally I would just make a rough guess based off req/sec, execution times etc and fine tune with ab.</span></p><div><p class="MsoNormal"><span lang="EN-US"> </span></p><div><p class="MsoNormal"><span lang="EN-US">On 26 October 2010 11:58, SplitIce <<a href="mailto:mat999@gmail.com" target="_blank">mat999@gmail.com</a>> wrote:</span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">ive found that if you have no blocking functions in php, aka its CPU bound then number of CPU cores+1 is the most efficient. If it has mysql (most likely does) and other IO bound operations then *2 or *3 is fine. values between 20-30 are common in decent scale web servers, in fact on my i7 8gb ram I run 20, on my amd x2 4gb ram I run 15.</span></p>
<div><div><div><p class="MsoNormal"><span lang="EN-US">On Tue, Oct 26, 2010 at 9:52 PM, Phil Bayfield <<a href="mailto:phil@techlightenment.com" target="_blank">phil@techlightenment.com</a>> wrote:</span></p></div></div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span lang="EN-US">Sorry didn't read you config before posting, you already have this. :)</span></p>
<div><p class="MsoNormal"><span lang="EN-US"> </span></p></div><div><p class="MsoNormal"><span lang="EN-US">You probably need to reduce the number of child processes, more is not better.</span></p></div><div><p class="MsoNormal">
<span lang="EN-US"> </span></p></div><div><p class="MsoNormal"><span lang="EN-US">On intensive PHP applications I've found lower is better.</span></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span></p></div>
<div><p class="MsoNormal"><span lang="EN-US">For example, if you have 100 concurrent connections, this doesn't mean you necessarily need 100 PHP-FPM children.</span></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span></p>
</div><p class="MsoNormal"><span lang="EN-US"> </span></p></div></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a></span></p></div></blockquote></div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
<br clear="all"><br>-- <br><a href="http://thewarezscene.org" target="_blank">Warez Scene</a> <a href="http://www.nexusddl.com" target="_blank">Free Rapidshare Downloads</a></span></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt">
<span lang="EN-US"><br>_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br><a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a></span></p>
</div><p class="MsoNormal"><span lang="EN-US"> </span></p></div></div></div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br></blockquote></div><br></div>