服务器一直都是用的lnmpa环境,之前流量大涨的时候出现apache假死才发现并发连接数不够用了
修改方法:
修改httpd-mpm.conf配置文件的prefork配置部分
# 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 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 1000 ##必须放在MaxClients上面 且值>=MaxCliens
MaxClients 1000
MaxRequestsPerChild 10000
查看当然Apache连接数: ps aux | grep httpd | wc -l