【www.bbyears.com--apache】
当网站访问过大的时候,而默认情况下apache的最大并发量是很小的。以下是在window下面修改apache最大并发数的方法步骤。
首先运行cmd,将当前目录切换到apache安装目录下的bin目录中,运行 httpd.exe -l ,会出现如下结果。
D:\phpServer\apache2.2\bin>httpd.exe -l
Compiled in modules:
core.c
mod_win32.c
mpm_winnt.c
http_core.c
mod_so.c
httpd.exe-l
如图可看出 当前模式为 winnt 模式(mpm_winnt.c)。
接着打开httpd.conf文件,去掉 Include conf/extra/httpd-mpm.conf 前面的#,保存。
再代开extra目录下面的httpd-mpm.conf文件,找到:
代码如下# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
ThreadsPerChild 1000
MaxRequestsPerChild 0
将ThreadsPerChild修改为你想要的大小即可。
最后重启apache生效。