希望有人可以指出我正确的方向,因为我花了最后一周试图弄清楚“问题”在哪里但未能实现,试图发布到Apache用户的邮件列表但是想在这里反弹同样.
在CentOS 5.8上运行Apache 2.2.3 mod_PHP.
在流量很大的每一天,我们都遇到了Apache不再响应任何HTTP请求的问题.
它听起来像是一个标准的MaxClients问题,但似乎并非如此.
此外,在此期间登录到机器的负载平均值低于1,并且仍然有足够的RAM可用.
查看/ var / log / httpd / error_log我注意到以下模式:
[Mon Apr 30 07:00:34 2012] [info] server seems busy,(you may need to increaseStartServers,or Min/MaxSpareServers),spawning 32 children,there are 0 idle,and 905 total children [Mon Apr 30 07:00:35 2012] [info] server seems busy,(you may need to increase StartServers,and 937 total children [Mon Apr 30 07:00:36 2012] [info] server seems busy,and 969 total children [Mon Apr 30 07:00:37 2012] [info] server seems busy,there are 35 idle,and 1001 total children [Mon Apr 30 07:00:42 2012] [debug] mpm_common.c(663): (70007)The timeout specified has expired: connect to listener on [::]:80 <br> [Mon Apr 30 07:00:49 2012] [debug] mpm_common.c(663): (70007)The timeout specified has expired: connect to listener on [::]:80 <br> [Mon Apr 30 07:00:56 2012] [debug] mpm_common.c(663): (70007)The timeout specified has expired: connect to listener on [::]:80 <br> [Mon Apr 30 07:01:03 2012] [debug] mpm_common.c(663): (70007)The timeout specified has expired: connect to listener on [::]:80 <br>
每天几次,在1000名儿童之后,Apache停止响应并且必须重新启动以便再次工作.
我已经回顾了几周前的error_log,它是相同的模式,服务器击中了1000个孩子,然后立即吐出
[debug] mpm_common.c(663):( 70007)指定的超时已到期:连接到[::]:80错误消息上的监听器并停止响应.
然而,服务器上的负载非常低……
即使我尝试请求一个简单的index.html文件,它也会超时.
以下是配置中的相关部分:
Timeout 45 KeepAlive On MaxKeepAliveRequests 10000 KeepAliveTimeout 3 <IfModule prefork.c> StartServers 80 MinSpareServers 50 MaxSpareServers 120 ServerLimit 3500 MaxClients 3500 MaxRequestsPerChild 2000 </IfModule>
任何人都知道为什么在停止处理更多请求之前Apache能够达到的神奇数量为1000?
或者如何理解(70007)指定的超时已过期:连接到[::]:80消息上的监听器?
指的是什么“超时指定”?
我仔细检查了Max Open Files,它之前是1024,但现在是16384,仍然是同样的问题.