热搜词
发表于 2009-9-1 16:17:19 | 显示全部楼层 |阅读模式
1. Apache2.0 中的httpd.conf文件中的MaxClients可以根据系统所要承受的压力(同时接受最多客户请求,若超过此数量,多于的请求只能排队)来进行设置,默认为150. 不过这个参数是受Apache2.0内的内置的ServerLimit所限定.  因此,要修改MaxClients的参数,最好首先重新设置下ServerLimit的参数,并且ServerLimit的参数值必须大于MaxClients的参数值,同时,对ServerLimit的设置必须在MaxClients的设置之前.  记住:重启生效!!

默认配置(在默认配置的时候,在httpd.conf文件中我们看不到ServerLimit这个参数的配置):
# 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         5
MinSpareServers      5
MaxSpareServers     10
MaxClients         150
MaxRequestsPerChild  0
</IfModule>

修改后的配置(这里,我们将MaxClients修改为500; 但首先,我们必须添加ServerLimit的参数配置,而且从位置上看,ServerLimit必须在MaxClients之前):
# 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
# ServerLimit: Modify the default ServerLimit 256, so that we can increase teh
# MaxClient manually.
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
ServerLimit        500
MaxClients         500
MaxRequestsPerChild  0
</IfModule>
记住:重启生效!!

全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-12-23 23:18 , Processed in 0.162320 second(s), 22 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team