/var/logs/httpd/error.log 內有這段訊息
[error] server reached MaxClients setting, consider raising the MaxClients setting
Apache 超過最大連線數,如果你主機內的伺服器程式是 Apache 2.0以上的話,可以不用重新編譯,只要開啟 httpd.conf 修改 MaxClients 選項即可。
在調整之前首先要檢查一下apache運行在哪一種模式下是prefork還是worker,如果不知道自己的apache是那種模式,可以使用“/usr/sbin/httpd -l”命令來確認,當檢查出是哪一種模式之後,就可以找到 /etc/httpd/conf/httpd.conf 中對應的配置部分來修改。
這是系統預設的值
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
改寫為
<IfModule prefork.c>
StartServers 80
MinSpareServers 50
MaxSpareServers 150
ServerLimit 1024
MaxClients 768
MaxRequestsPerChild 4000
</IfModule>
完成後重新啟動 Apache 即可。
沒有留言:
發佈留言