Apache下WEB访问响应过慢的解决

今天学校首页服务器出了问题,访问极慢。用下载进行网速测试,发现连接服务器速度很慢,但连接上之后的下载速度却很正常。
学校服务器是HP刀片机,预装LinuxAS4,WEB服务使用Apache。
使用top进行检查,CPU使用率正常,物理内存只使用了不到60%,Swap甚至还没用到(服务器四小时前刚刚重启过)。因此排除了服务器资源耗尽导致响应过慢的可能性。
接下来就想到有可能是Apache的连接数限制过低。于是修改/etc/httpd/conf/httpd.conf。将

<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>

中的ServerLimit和MaxClients增大五倍,然后重启Apache,问题解决。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>