apache - AH00161 : server reached MaxRequestWorkers setting, 考虑提高 MaxRequestWorkers 设置

标签 apache ubuntu-14.04

我有一个非常繁忙的服务器:PHP (Wordpress) 使用 W3TotalCache APC、Varnish for Apache 和 Cloudflare 来处理所有流量。
Ubuntu 14.04.4 LTS

只有一个网站的平均点击量约为 6 万次/天。

我时不时地收到这条消息,一天几次。与暂时的流量高峰无关,我们将时间与 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。但仍在发生。

这是我目前的 apache2.conf。
代码:
<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>

有很多空闲内存,平均负载大约为 0.5,有时超过 1。但从未见过它高于 2。因此服务器似乎可以正常处理流量。
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中断?

//j

最佳答案

基本上配置被覆盖:
/etc/apache2/mods-available/mpm_prefork.conf
我将新设置放在该文件中,现在 Apache 似乎可以正常工作。
希望这对其他人有帮助,不要将您的配置直接放在 apache2.conf 或 httpd.conf 中。确保更改所有加载的配置文件。

关于apache - AH00161 : server reached MaxRequestWorkers setting, 考虑提高 MaxRequestWorkers 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36924952/

相关文章:

php - 从特定 IP 地址访问时无法使用 Joomla 管理控制台

Apache Tomcat 在 Google Compute Engine f1-micro 中崩溃

python-3.x - 如何使用psycopg2恢复数据库转储

python - Python3.4无法导入Django

java - cloudera manager 5.4在ubuntu 14.04上安装卡住java oracle jdk(可信)

.net - MonoDevelop 因每个错误而崩溃

c - 检索 apr_pool_tag 标签值

java - 使用 APACHE Shiro 将用户重定向到特定 URL

java - apache poi 中的shiftRows 不工作

php - 如何解决错误 "[ErrorException] file_get_contents(/var/www/laravel/.env): failed to open stream: No such file or directory"?