代潇瑞博客

修改apache的最大并发连接量

| 点击次数:7211

当网站访问过大的时候,而默认情况下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

<IfModule mpm_winnt_module>

    ThreadsPerChild      1000

    MaxRequestsPerChild    0

</IfModule>


将ThreadsPerChild修改为你想要的大小即可。


最后重启apache生效。

【相关推荐】

触屏版 | 电脑版

Copyright © 2013 代潇瑞博客手机版

QQ: 446673330

粤ICP备13071969号-1