AH00161:服务器已达到MaxRequestWorkers设置,请考虑提高MaxRequestWorkers设置 [英] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
问题描述
我有一个非常繁忙的服务器:使用W3TotalCache APC的PHP(Wordpress),用于Apache的Varnish和Cloudflare来处理所有流量. Ubuntu 14.04.4 LTS
I've got a quite busy server: PHP (Wordpress) using W3TotalCache APC, Varnish for Apache and Cloudflare to handle all traffic. Ubuntu 14.04.4 LTS
只有一个网站的平均每日点击量约为6万次.
Only one website with an average about 60k hits/day.
我每天不时收到几次此消息.与暂时的流量激增无关,我们将时间与Google Analytics(分析)进行了比较.
I get this message every now and then, few times a day. Has nothing to do with temporarily traffic spikes, we compared times with Google Analytics.
Thu Apr 28 14:14:42.938075 2016] [mpm_prefork:error] [pid 19137] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Thu Apr 28 15:43:25.594147 2016] [core:notice] [pid 19137] AH00051: child pid 19866 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594313 2016] [core:notice] [pid 19137] AH00051: child pid 20386 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594407 2016] [core:notice] [pid 19137] AH00051: child pid 19143 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594498 2016] [core:notice] [pid 19137] AH00051: child pid 19144 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594572 2016] [core:notice] [pid 19137] AH00051: child pid 20597 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594642 2016] [core:notice] [pid 19137] AH00051: child pid 20395 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594704 2016] [core:notice] [pid 19137] AH00051: child pid 20424 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594785 2016] [core:notice] [pid 19137] AH00051: child pid 20598 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594870 2016] [core:notice] [pid 19137] AH00051: child pid 19861 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Thu Apr 28 15:43:25.594957 2016] [core:notice] [pid 19137] AH00051: child pid 19782 exit signal Segmentation fault (11), possible coredump in /etc/apache2
....
....
因此,我已经将MaxRequestWorkers首先增加到100,然后增加到500,现在增加到1024.但是仍然在发生.
So I've increased MaxRequestWorkers first to 100, then 500, now its at 1024. But still happening.
这是我当前的apache2.conf. 代码:
This is my apache2.conf at the moment. Code:
<IfModule mpm_worker_module>
StartServers 256
MinSpareThreads 256
MaxSpareThreads 256
MaxClients 256
ServerLimit 256
ThreadLimit 256
ThreadsPerChild 256
MaxRequestWorkers 1024
MaxConnectionsPerChild 0
MaxRequestPerChild 1000
</IfModule>
有很多可用的RAM,平均负载约为0.5,有时超过1.但是从未见过高于2.因此服务器似乎可以正常处理流量.
There is a lot of free RAM, and load average is around 0.5, sometimes over 1. But never seen it higher then 2. So server seems healthy to handle the traffic.
top - 16:07:47 up 3 days, 18:18, 2 users, load average: 0.57, 0.46, 0.55
Tasks: 113 total, 1 running, 112 sleeping, 0 stopped, 0 zombie
%Cpu(s): 10.5 us, 2.0 sy, 0.0 ni, 87.4 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 8176816 total, 2372560 used, 5804256 free, 189684 buffers
KiB Swap: 0 total, 0 used, 0 free. 1286692 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21930 www-data 20 0 337212 83308 60072 S 24.9 1.0 0:52.89 apache2
21945 www-data 20 0 327640 72684 58816 S 24.3 0.9 0:48.37 apache2
1182 nobody 20 0 702868 442268 83496 S 0.7 5.4 42:41.32 varnishd
关于Apache为何中断的任何想法?
Any ideas why Apache interrupts?
//j
推荐答案
基本配置已被覆盖: /etc/apache2/mods-available/mpm_prefork.conf
Basically config got overritten in: /etc/apache2/mods-available/mpm_prefork.conf
我将新设置放入该文件中,看来Apache现在可以正常工作了.
I put the new setting in that file and seems Apache works correct now.
希望这对其他人有帮助,不要将您的配置直接放在apache2.conf或httpd.conf中.确保更改所有已加载的配置文件.
Hopefully this helps someone else, dont put your config straight in apache2.conf or httpd.conf. Make sure you change all loaded config files.
这篇关于AH00161:服务器已达到MaxRequestWorkers设置,请考虑提高MaxRequestWorkers设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!