【apache最大连接数apache并发数】Apache最大连接数/apache并发数修改方法

更新时间:2017-11-25    来源:apache    手机版     字体:

【www.bbyears.com--apache】

Apache的最大连接数,默认为256个。

修改apache的最大连接数,方法如下:

步骤一

先修改 /path/apache/conf/httpd.conf文件。

 代码如下 # vi httpd.conf
将“#Include conf/extra/httpd-mpm.conf”前面的 “#” 去掉,保存。

步骤二

 代码如下 再修改 /path/apache/conf/extra/httpd-mpm.conf文件。
# vi httpd-mpm.conf

找到 这一行

找到文件 /etc/httpd/conf/httpd.conf 并修改下面参数,将默认的256改成1000

 代码如下

KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# 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: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 1000
MaxClients 1000
MaxRequestsPerChild 4000

ServerLimit 该指令一定要放在第一行。

修改后,一定不要apachectl restart,而是先 apachectl stop 然后再 apachectl start才可以。

本文来源:http://www.bbyears.com/jiaocheng/37298.html

热门标签

更多>>

本类排行