Apache:Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
首次完全用官方安装包搭建,没有考虑到大流量的问题,一上去发现Apache直接挂掉,反应极其慢。看到日志error.log中:
[warn] Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
再看上面一句:
Starting 64 worker threads.
在httpd.conf中并没有设置线程数量,Apache默认开启了64个,看来是远远不够。于是上网一查,在httpd.conf加入以下内容:
<IfModule mpm_winnt_module>
ThreadsPerChild 512
MaxRequestsPerChild 0
</IfModule>
这样开启了512工作线程。这个值根据需要可能要慢慢调整
重启Apache,运行正常,日志里没有再出现[warn],反应也非常快啰