vps半夜休眠

论坛: 
提示错误信息:
[Sat Apr 26 01:49:25 2014] [notice] child pid 22395 exit signal Segmentation fault (11)
[Sat Apr 26 01:56:35 2014] [error] server reached MaxClients setting, consider raising the MaxClients setting
下面我们来修改一下参数,将其中
 
[xhtml] view plain
copy
 
<IfModule prefork.c>  
StartServers       8  
MinSpareServers    5  
MaxSpareServers   20  
ServerLimit      256  
MaxClients       256  
MaxRequestsPerChild  4000  
</IfModule>   
 
修改为
 
[xhtml] view plain
copy
 
<IfModule prefork.c>  
StartServers     16  
MinSpareServers  10  
MaxSpareServers  40  
ServerLimit     512  
MaxClients      512  
MaxRequestsPerChild  20  //这个调整这么小的数值,不知道会产生什么后果!  
</IfModule>  
等待测试结果,第二天发现不再休眠了。
比如设置为50?如果太小的话,重新产生一个apache进程也是要消耗资源的,这是一个平衡问题。

httpd.conf里面的几个关乎内存占用和性能的价格重要参数如下(仅用于常见的Apache Prefork模式):
StartServers Apache启动时创建的子进程数量
MinSpareServers 最小空闲子进程数量
MaxSpareServers 最大空闲子进程数量
ServerLimit (此参数只要不比MaxClients小就可以了)
MaxClients 最大同时能够处理的请求数
MaxRequestsPerChild 每个子进程处理多少请求之后自动结束,并且释放内存
KeepAlive 是否保持连接
MaxKeepAliveRequests 并发保持连接的最大数量
KeepAliveTimeout 保持连接超时设置
dashan 答复于