开启mpm:在httpd.conf文件中去掉 Include conf/extra/httpd-mpm.conf 前面的“#”号(提示:如果没有此段代码可以新加。没有此文件httpd-mpm.conf可以新建,也可以直接加代码到)
优化配置:
服务器启动时建立的线程数 StartServers 200
空闲子进程的最小数量 MinSpareServers 100
空闲子进程的最大数量 MaxSpareServers 200
允许同时伺服的最大接入请求数量 MaxClients 800
每个子进程在其生存期内允许伺服的最大请求数量 MaxRequestsPerChild 3000
代码(前提是apache的工作模式是prefork):
<IfModule mpm_prefork_module>
StartServers 200
MinSpareServers 100
MaxSpareServers 200
MaxClients 800
MaxRequestsPerChild 3000
</IfModule>
如果是windows系统的服务器,请参考:Windows下Apache的优化