apache 刚启动就启动很多httpd进程

apache 刚启动就启动很多httpd进程

我的apache 服务器刚启动就产生很多httpd进程,而且一直增加,访问网站越来越慢也,直到httpd disfunct;
root      3621     1  0 10:11 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3652  3621  0 10:11 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3660  3621  0 10:11 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3666  3621  0 10:13 ?        00:00:01 /usr/local/apache/bin/httpd -k start
root      3686  2302  0 10:20 pts/3    00:00:00 -bash
daemon    3726  3621  0 10:21 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3805  3621  0 10:40 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3813  3621  0 10:42 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3855  3621  0 10:51 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3861  3621  0 10:51 ?        00:00:00 /usr/local/apache/bin/httpd -k start
daemon    3865  3621  0 10:51 ?        00:00:00 /usr/local/apache/bin/httpd -k start
这时候很多netstat很多乱七八糟的ip连接过来也
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:123.125.8.203:60719  ESTABLISHED
tcp        0    132 ::ffff:192.168.1.88:22      ::ffff:192.168.1.158:1606   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:222.69.230.29:3518   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:125.198.147.231:4161 TIME_WAIT   
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:121.26.132.5:60489   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:88.7.217.14:4722     ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:219.78.27.92:2411    TIME_WAIT   
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:60.18.220.21:47375   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:22      ::ffff:192.168.1.158:1683   ESTABLISHED
tcp        0      1 ::ffff:192.168.1.88:80      ::ffff:85.136.98.103:30281  LAST_ACK   
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:121.115.138.12:59575 ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:80.26.105.218:61039  ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:60.191.43.3:4446     ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:121.20.255.241:59155 ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:125.198.147.231:4106 ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:123.6.141.118:1206   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:84.232.103.4:54656   ESTABLISHED
tcp        0      0 ::ffff:192.168.1.88:80      ::ffff:59.33.26.221:1930    ESTABLISHED
tcp        0      1 ::ffff:192.168.1.88:80      ::ffff:59.33.26.221:1480    LAST_ACK   
我想问一下这个到底是咋回事?每一个http请求都会产生一个httpd进程吗?不应该是这样子吧?
1.StartServers: number of server processes to start
StartServers就是httpd启动时的服务进程数

2.并不是每个请求都会产生一个httpd进程,是每个请求成功后,netstat都会有一个ESTABLISHED 连接成功的项
MaxRequestsPerChild: maximum number of requests a server process serves
一个httpd能够请求服务数是MaxRequestsPerChild
谢谢你的回复:
我apache版本是httpd-2.2.8,httpd.conf文件里怎么没有
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerchild 10
</IfModule>
这些东西,我直接添加上应该可以吧?


QUOTE:
原帖由 minarvin 于 2008-8-23 13:39 发表
谢谢你的回复:
我apache版本是httpd-2.2.8,httpd.conf文件里怎么没有

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerchild 10

这些东西,我直接添加上应该可 ...

你这是 apache2 吧,有些 发行版 配置放的地方不统一,不在 httpd.conf 就应该在别的,如 apache2.conf 等里!

仔细看配置文件吧!
如果并发用户很多,建议使用MPM方式,可以少很多进程来处理。