查看 Apache并发请求数及其TCP连接状态

服务器上的一些统计数据:

1)统计80端口连接数
netstat -nat|grep -i "80"|wc -l

2)统计httpd协议连接数
ps -ef|grep httpd|wc -l

3)、统计已连接上的,状态为“established
netstat -na|grep ESTABLISHED|wc -l

4)、查出哪个IP地址连接最多,将其封了.
netstat -na|grep ESTABLISHED|awk {print $5}|awk -F: {print $1}|sort|uniq -c|sort -r +0n

netstat -na|grep SYN|awk {print $5}|awk -F: {print $1}|sort|uniq -c|sort -r +0n

---------------------------------------------------------------------------------------------

1、查看apache当前并发访问数:
netstat -an | grep ESTABLISHED | wc -l

对比httpd.conf中MaxClients的数字差距多少。

2、查看有多少个进程数:
ps aux|grep httpd|wc -l

3、可以使用如下参数查看数据
server-status?auto

#ps -ef|grep httpd|wc -l
1388
统计httpd进程数,连个请求会启动一个进程,使用于Apache服务器。
表示Apache能够处理1388个并发请求,这个值Apache可根据负载情况自动调整。

#netstat -nat|grep -i "80"|wc -l
4341
netstat -an会打印系统当前网络链接状态,而grep -i "80"是用来提取与80端口有关的连接的,wc -l进行连接数统计。
最终返回的数字就是当前所有80端口的请求总数。

#netstat -na|grep ESTABLISHED|wc -l
376
netstat -an会打印系统当前网络链接状态,而grep ESTABLISHED 提取出已建立连接的信息。 然后wc -l统计。
最终返回的数字就是当前所有80端口的已建立连接的总数。

netstat -nat||grep ESTABLISHED|wc - 可查看所有建立连接的详细记录

查看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表示处理完毕,等待超时结束的请求数。

---------------------------------------------------------------------------------------------

查看Apache并发请求数及其TCP连接状态

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

ps -ef | grep httpd | wc -l

  返回结果示例:
  1388
  表示Apache能够处理1388个并发请求,这个值Apache可根据负载情况自动调整,我这组服务器中每台的峰值曾达到过2002。
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">查看Apache的并发请求数及其TCP连接状态:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  Linux命令:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">返回结果示例:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  LAST_ACK 5</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  SYN_RECV 30</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  ESTABLISHED 1597</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  FIN_WAIT1 51</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  FIN_WAIT2 504</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  TIME_WAIT 1057</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  其中的SYN_RECV表示正在等待处理的请求数;ESTABLISHED表示正常数据传输状态;TIME_WAIT表示处理完毕,等待超时结束的请求数。</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  状态:描述</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  CLOSED:无连接是活动 的或正在进行</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  LISTEN:服务器在等待进入呼叫</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  SYN_RECV:一个连接请求已经到达,等待确认</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  SYN_SENT:应用已经开始,打开一个连接</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  ESTABLISHED:正常数据传输状态</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  FIN_WAIT1:应用说它已经完成</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  FIN_WAIT2:另一边已同意释放</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  ITMED_WAIT:等待所有分组死掉</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  CLOSING:两边同时尝试关闭</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  TIME_WAIT:另一边已初始化一个释放</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">  LAST_ACK:等待所有分组死掉</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></wbr></wbr></wbr>

如发现系统存在大量TIME_WAIT状态的连接,通过调整内核参数解决
vim<wbr><wbr>/etc/sysctl.conf<br> 编辑文件,加入以下内容:<br> net.ipv4.tcp_syncookies<wbr><wbr>=<wbr><wbr>1<br> net.ipv4.tcp_tw_reuse<wbr><wbr>=<wbr><wbr>1<br> net.ipv4.tcp_tw_recycle<wbr><wbr>=<wbr><wbr>1<br> net.ipv4.tcp_fin_timeout<wbr><wbr>=<wbr><wbr>30<br> 然后执行<wbr><wbr>/sbin/sysctl<wbr><wbr>-p<wbr><wbr>让参数生效。<br><br> net.ipv4.tcp_syncookies<wbr><wbr>=<wbr><wbr>1<wbr><wbr>表示开启SYN<wbr><wbr>cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击,默认为0,表示关闭;<br> net.ipv4.tcp_tw_reuse<wbr><wbr>=<wbr><wbr>1<wbr><wbr>表示开启重用。允许将TIME-WAIT<wbr><wbr>sockets重新用于新的TCP连接,默认为0,表示关闭;<br> net.ipv4.tcp_tw_recycle<wbr><wbr>=<wbr><wbr>1<wbr><wbr>表示开启TCP连接中TIME-WAIT<wbr><wbr>sockets的快速回收,默认为0,表示关闭。<br> net.ipv4.tcp_fin_timeout<wbr><wbr>修改系統默认的<wbr><wbr>TIMEOUT<wbr><wbr>时间<br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

下面附上TIME_WAIT状态的意义:

客户端与服务器端建立TCP/IP连接后关闭SOCKET后,服务器端连接的端口
状态为TIME_WAIT

是不是所有执行主动关闭的socket都会进入TIME_WAIT状态呢?
有没有什么情况使主动关闭的socket直接进入CLOSED状态呢?

主动关闭的一方在发送最后一个<wbr><wbr>ack<wbr><wbr>后<br> 就会进入<wbr><wbr>TIME_WAIT<wbr><wbr>状态<wbr><wbr>停留2MSL(max<wbr><wbr>segment<wbr><wbr>lifetime)时间<br> 这个是TCP/IP必不可少的,也就是“解决”不了的。<br><br> 也就是TCP/IP设计者本来是这么设计的<br> 主要有两个原因<br> 1。防止上一次连接中的包,迷路后重新出现,影响新连接<br> (经过2MSL,上一次连接中所有的重复包都会消失)<br> 2。可靠的关闭TCP连接<br> 在主动关闭方发送的最后一个<wbr><wbr>ack(fin)<wbr><wbr>,有可能丢失,这时被动方会重新发<br> fin,<wbr><wbr>如果这时主动方处于<wbr><wbr>CLOSED<wbr><wbr>状态<wbr><wbr>,就会响应<wbr><wbr>rst<wbr><wbr>而不是<wbr><wbr>ack。所以<br> 主动方要处于<wbr><wbr>TIME_WAIT<wbr><wbr>状态,而不能是<wbr><wbr>CLOSED<wbr><wbr>。<br><br> TIME_WAIT<wbr><wbr>并不会占用很大资源的,除非受到攻击。<br><br> 还有,如果一方<wbr><wbr>send<wbr><wbr>或<wbr><wbr>recv<wbr><wbr>超时,就会直接进入<wbr><wbr>CLOSED<wbr><wbr>状态</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>


如何合理设置apache httpd的最大连接数?

手头有一个网站在线人数增多,访问时很慢。初步认为是服务器资源不足了,但经反复测试,一旦连接上,不断点击同一个页面上不同的链接,都能迅速打开,这种现象就是说明apache最大连接数已经满了,新的访客只能排队等待有空闲的链接,而如果一旦连接上,在keeyalive 的存活时间内(KeepAliveTimeout,默认5秒)都不用重新打开连接,因此解决的方法就是加大apache的最大连接数。

1.在哪里设置?
apache 2.24,使用默认配置(FreeBSD 默认不加载自定义MPM配置),默认最大连接数是250

在/usr/local/etc/apache22/httpd.conf中加载MPM配置(去掉前面的注释):
# Server-pool management (MPM specific)
Include etc/apache22/extra/httpd-mpm.conf

可见的MPM配置在/usr/local/etc/apache22/extra/httpd-mpm.conf,但里面根据httpd的工作模式分了很多块,哪一部才是当前httpd的工作模式呢?可通过执行 apachectl -l 来查看:
Compiled in modules:
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">core.c</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">prefork.c</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">http_core.c</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">mod_so.c</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">看到prefork 字眼,因此可见当前httpd应该是工作在prefork模式,prefork模式的默认配置是:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">&lt;IfModule mpm_prefork_module&gt;</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">StartServers</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">5</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">MinSpareServers</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">5</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">MaxSpareServers</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">10</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">MaxClients</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">150</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">MaxRequestsPerChild</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">0</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">&lt;/IfModule&gt;</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">2.要加到多少?</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">连接数理论上当然是支持越大越好,但要在服务器的能力范围内,这跟服务器的CPU、内存、带宽等都有关系。</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">查看当前的连接数可以用:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">ps aux | grep httpd | wc -l</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">或:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">pgrep httpd|wc -l</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">计算httpd占用内存的平均数:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">ps aux|grep -v grep|awk '/httpd/{sum+=$6;n++};END{print sum/n}'</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">由于基本都是静态页面,CPU消耗很低,每进程占用内存也不算多,大约200K。</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">服务器内存有2G,除去常规启动的服务大约需要500M(保守估计),还剩1.5G可用,那么理论上可以支持1.5*1024*1024*1024/200000 = 8053.06368</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">约8K个进程,支持2W人同时访问应该是没有问题的(能保证其中8K的人访问很快,其他的可能需要等待1、2秒才能连上,而一旦连上就会很流畅)</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">控制最大连接数的MaxClients ,因此可以尝试配置为:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">&lt;IfModule mpm_prefork_module&gt;</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">StartServers</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span></span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值