Apache2 为什么有八个httpd过程?
我使用的是linux EC2,启动apache后立即看到8个httpd进程,其中2个由root所有,其余由“apache”所有:Apache2 为什么有八个httpd过程?,apache2,Apache2,我使用的是linux EC2,启动apache后立即看到8个httpd进程,其中2个由root所有,其余由“apache”所有: root 22966 1 0 08:03 ? 00:00:00 /usr/sbin/httpd root 22968 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd apache 22969 22966 0 08:03 ? 00:00:00 /usr/sbin
root 22966 1 0 08:03 ? 00:00:00 /usr/sbin/httpd
root 22968 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22969 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22970 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22971 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22972 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22973 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
apache 22974 22966 0 08:03 ? 00:00:00 /usr/sbin/httpd
为什么有8个过程?我假设这与prefork/worker配置有关,可能是prefork,但我的/etc/httpd/conf/httpd.conf文件是这样的,没有定义8或6,也许我遗漏了什么
# 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
<IfModule prefork.c>
StartServers 5
MinSpareServers 3
MaxSpareServers 9
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 4
MaxClients 300
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
StartServer+MinSpare服务器?我以为StartServer包括MinSpare,不是吗?也许吧,是的。你能试试吗?参考: