我最近从 apache 2.2 升级到了 2.4(作为从 Debian wheezy 升级到 debian jessie 的一部分),我从拥有大量可用插槽来处理需求激增变成了几乎没有。Apache 似乎忽略了我的配置设置。
根据https://httpd.apache.org/docs/trunk/upgrading.html几个选项已重命名,但旧名称仍应有效。我尝试将名称更改为新名称,但没有任何变化。我还尝试注释掉围绕指令的“ifmodule”,但没有任何变化。
我目前在我的 apache2.conf 中有
#<IfModule mpm_worker_module>
ServerLimit 24
StartServers 10
MinSpareThreads 25
MaxSpareThreads 75.
ThreadLimit 64
ThreadsPerChild 64
MaxRequestWorkers 1536
MaxConnectionsPerChild 0
#</IfModule>
apache2ctl 目前显示。
Apache Server Status for localhost (via 127.0.0.1)
Server Version: Apache/2.4.10 (Debian) mod_mirrorbrain/2.18.1
Server MPM: worker
Server Built: Nov 28 2015 14:05:48
----------------------------------------------------------------------
Current Time: Thursday, 02-Jun-2016 16:35:50 UTC
Restart Time: Thursday, 02-Jun-2016 16:16:11 UTC
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 19 minutes 38 seconds
Server load: 1.76 1.46 1.84
Total accesses: 120523 - Total Traffic: 15.5 GB
CPU Usage: u29.85 s43.98 cu0 cs0 - 6.27% CPU load
102 requests/sec - 13.5 MB/second - 134.7 kB/request
104 requests currently being processed, 46 idle workers
KWWKWWW___WKK___KW____KWW_WKWWWWKCWWKCW_WWWWW_KWWW_KWKWKWKK__KW_
WWWWWWKWWKK_W__WKWC____WW_CKKW_W_KWK_WKW_____W_W_W_WWK_KWKWKWW_K
W_W__K_KKW__WW_KCCK_WW
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process
答案1
好的,我找到问题了。
似乎 Debian 将一组与服务器限制相关的设置从 apache2.conf 移出并移至 mods-available/mpm_worker.conf 。我的系统最终同时拥有两者,并且 mpm_worker.conf 中的设置覆盖了 apache2.conf 中的设置。
注释掉 mpm_worker.conf 中的设置解决了该问题。