Apache限制并发连接数为150

Ec2 Ubuntu服务器运行Apache和PHP。 移动应用程序托pipe在服务器上。 应用程序连接到80端口上的服务器。 问题是Apache的限制在150个高峰时间进程。 当apache有150个进程时,Cpu几乎100%空闲。 在Prefork mpm上将最大客户数量增加到500个。 但它仍然限制在150stream程。 Ps aux和newrelic在150进程显示apache进程限制。

问题是MaxRequestWorkers在/etc/apache2/mods-enabled/mpm_prefork.conf上是150,在apache conf上增加值之后它不会改变。 现在改成了

 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 ServerLimit 1200 MaxRequestWorkers 1200 MaxConnectionsPerChild 1000 </IfModule> 

-on /etc/apache2/mods-enabled/mpm_prefork.conf ,现在Apache获得更多的点击。

可能是ServerLimitvariables。 它通常还没有在默认的configuration文件中,所以你必须添加它。 重新启动Apache以使其生效(重新加载不起作用)。

我通常会这样做:

 <IfModule mpm_prefork_module> StartServers 150 MinSpareServers 150 MaxSpareServers 150 MaxClients 150 Serverlimit 150 MaxRequestsPerChild 10000 </IfModule> 

这将禁用工人创build/销毁,我看不出任何意义。

阅读MPM模块的Apache文档 。 看来您需要增加MaxRequestServers值。

该页面还有一个链接到性能调整文档。