终于上来了,请教问题

终于上来了,请教问题

WARNING: MaxClients of 2500 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256.  To increase, please see the ServerLimit
directive.

apache2更改最大连接数是不需要重新编译的吧?
我的apache版本2.0.58,工作模式prefork。最近一段时间,apache总是突然莫名其妙的就死掉,查看日志,发现

[Tue Aug 19 10:21:30 2008] [error]server reached MaxClients setting, consider raising the MaxClients setting
[Tue Aug 19 10:21:30 2008] [error] could not make child process 1455 exit, attempting to continue anyway
[Tue Aug 19 10:21:30 2008] [error] could not make child process 1456 exit, attempting to continue anyway
[Tue Aug 19 10:21:30 2008] [error] could not make child process 1457 exit, attempting to continue anyway
[Tue Aug 19 10:21:30 2008] [error] could not make child process 1458 exit, attempting

应该是最大连接数不够了,于是我将

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers        10
MinSpareServers      10
MaxSpareServers    15
MaxClients        2500
ServerLimit        3000
MaxRequestsPerChild  10000
</IfModule>

更改为如上模样。

重启apache后,出现个警告:
WARNING: MaxClients of 2500 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256.  To increase, please see the ServerLimit
directive.

这个为什么会产生这个警告啊,让我将MaxClients降为256?

谢谢
找到原因了。

prefork模式下

<IfModule prefork.c>
ServerLimit  3000
StartServers        10
MinSpareServers      10
MaxSpareServers    15
MaxClients        2500
MaxRequestsPerChild  10000
</IfModule>

ServerLimit这个参数放在这几个参数的最上面,否则无效,还会产生一个警告。放在最上面就没事了
似乎worker模式下也要这么放。
恭喜楼主~~
好,学习了。谢谢~

ServerLimit 不用小于256了?
顶。
将顺序颠倒还真是管用