这两天搭建了一组Apache服务器,每台服务器4G内存,采用的是prefork模式,一开始设置的连接数太少了,需要较长的时间去响应用户的请求,后来修改了一下Apache 2.0.59的配置文件httpd.conf:

# 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

StartServers 10
MinSpareServers 10
MaxSpareServers 15
ServerLimit 2000
MaxClients 2000
MaxRequestsPerChild 10000

查看httpd进程数(即prefork模式下Apache能够处理的并发请求数):

Linux命令:
ps -ef | grep httpd | wc -l

返回结果示例:1388

表示Apache能够处理1388个并发请求,这个值Apache可根据负载情况自动调整,我这组服务器中每台的峰值曾达到过2002。

查看Apache的并发请求数及其TCP连接状态:
Linux命令:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

(这条语句是从 新浪互动社区事业部技术总监王老大那儿获得的,非常不错)

返回结果示例:
LAST_ACK 5
SYN_RECV 30
ESTABLISHED 1597
FIN_WAIT1 51
FIN_WAIT2 504
TIME_WAIT 1057

其中的SYN_RECV表示正在等待处理的请求数;ESTABLISHED表示正常数据传输状态;TIME_WAIT表示处理完毕,等待超时结束的请求数。
by | 不指定 2008/08/15 10:31 | 服务器技术 | 评论(4) | 引用(0) | 阅读(520)
zaki1915 Email
2010/09/02 20:37
:P   :P   :P   :P   :P   :P   :P   :P   :P   :P          .          .          .          .          .          .          .          .          .     ,BVE-M-R0002-2.0
JoanGONZALES Email Homepage
2010/08/12 23:42
Thank you, it's very admirable information it might be very hospitable for students. For example last year when I had a difficult of time at the end of semester with a continual flow of academic assignments and mission, I had a awesome idea to buy it somewhere and than use <a href="http://www.plagiarismsearch.com">plagiarism checker</a>. I was so dead that I did not care for what can commence when my academic work was written by different person. To my adroitest surprise, research paper was desirable the price I paid for it. I was so contented with the quality and now everytime i use this service.
Lauren33Ware Email Homepage
2010/06/12 20:48
Your outcome connected with this topic is good and some people would utilize that for their example of thesis. And some scholars permanently take the support of the <a href="http://www.master-dissertations.com">dissertation</a> service.
Michele27Conley Email Homepage
2010/06/12 00:19
We do guess,  you have to take the <a href="http://www.4submission.com">article submission service</a> for your information just about this post, because that is really hot and has not to be hidden from public eyes!
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]