+ -
当前位置:首页 → 问答吧 → apache并发连接数的问题。

apache并发连接数的问题。

时间:2010-03-11

来源:互联网

<IfModule mpm_prefork_module>
    StartServers            20000
    MinSpareServers      20000
    MaxSpareServers     60000
    MaxClients             100000
    MaxRequestsPerChild   0
</IfModule>

20000个httpd的话,直接吃掉11G内存。
如果我创造的并发连接为5W,那么将会发现有那么几段时间内流量为0、网站无法响应。
(貌似apache不工作了,此时CPU占用率不高,内存大概吃掉15G,还尚有空余1G内存)

apache的并发跟什么有直接关系?
或者,是什么制约了apache的并发?

作者: marsaber   发布时间: 2010-03-11

弟一次看到这么设置的。

如果并发很高,可以使用works方式运行。这个占用资源小。但响应效率不如prefork。具体的可以看看我以前的发贴子。

作者: scyzxp   发布时间: 2010-03-11

your parameter value sets so high that your apache server can not compete properly it.finially the load of apache service is too heavy to work.

according to my experience,it is very difficult for single apache service to complete concurrently more than 5 thousands requests.

even if you have enough cpu and memory,you can not complete concurrently fifty thousands requests.

recommand that LVS share 5w request.otherwise no good ideas to solve it.

作者: todayhero   发布时间: 2010-03-12

or you use nginx instead of apache.nginx performance is much better than apache.nginx maybe solve this problem.

作者: todayhero   发布时间: 2010-03-12

StartServers            20000
    MinSpareServers      20000
    MaxSpareServers     60000
    MaxClients             100000


你主机什么配置?
你是参照哪些文章设置的这些参数?

作者: ruochen   发布时间: 2010-03-13

回复 5# ruochen


测试。
只是测试。
谢谢各位。

作者: marsaber   发布时间: 2010-03-14



QUOTE:
even if you have enough cpu and memory,you can not complete concurrently fifty thousands requests.
todayhero 发表于 2010-03-12 15:09



这个需要怎么设置?
指点一下吧。
谢谢。

作者: marsaber   发布时间: 2010-03-14