Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/mdaeo.org/usr/plugins/AMP/Action.php on line 388
LNMPA进程数优化httpd进程数调整

LNMPA进程数优化httpd进程数调整

2011-12-28T20:58:57

编辑文件:/usr/local/apache/conf/extra/httpd-mpm.conf

参照以下提示修改:IfModule mpm_prefork_module
StartServers 5              //启动时生成的进程数
MinSpareServers 5        //最小空闲线程数
MaxSpareServers 10     //最大空闲线程数
MaxClients 150           //客户端最大并发连接数
MaxRequestsPerChild 0 //子进程可处理的请求数,0意味着无限,可能会出现内存溢出,建议不要使用0,根据实际情况进行调整。

重启lnmpa:/root/lnmpa restart

查看当前httpd连接数:ps aux | grep httpd | wc -l 或者 pgrep httpd|wc -l

计算httpd占用内存的平均数:ps aux|grep -v grep|awk '/httpd/{sum+=$6;n++};END{print sum/n}'

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »
因本文不是用Markdown格式的编辑器书写的,转换的页面可能不符合MIP标准。