<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[Apache重负荷服务器应如何优化]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Wed, 24 Jan 2007 09:19:31 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	一天两万个请求确实不大，但如果在高峰时期出现，而晚间或其它时间没有，呈正态分布，且均是需要时间的下载服务，那负载还是很大的。<br/><br/>Apache允许为请求开的最大进程数是256,MaxClients的限制是256.如果用户多了，用户就只能看到Waiting for reply....然后等到下一个可用进程的出现。这个最大数，是Apache的程序决定的--它的NT版可以有1024，但Unix版只有256，你可以在src/include/httpd.h中<br/>看到：<br/>#ifndef HARD_SERVER_LIMIT<br/>#ifdef WIN32<br/>#define HARD_SERVER_LIMIT 1024<br/>#else<br/>#define HARD_SERVER_LIMIT 256<br/>#endif<br/>#endif<br/>你可以把它调到1024，然后再编译你的系统。记得在httpd.conf里也<br/>要更改相应配置，缺省好象是150。就下面的机器来说，调到512顶<br/>死了，如果再高，系统受不了。<br/><br/>另外，一些系统也限制了一个用户的最大进程数。你可以用ulimit -u<br/>来看。Linux一般是256。因此你要真想让Apache超过这个数，就得调整<br/>这个参数：<br/>ulimit -u unlimited<br/>这个参数要在Apache运行之前修改，因此建议加到apachectl里：<br/>case $ARG in<br/>start)<br/>if [ $RUNNING -eq 1 ]; then<br/>echo "$0 $ARG: httpd (pid $PID) already running"<br/>continue<br/>改成<br/>case $ARG in<br/>start)<br/>ulimit -u unlimited<br/>if [ $RUNNING -eq 1 ]; then<br/>echo "$0 $ARG: httpd (pid $PID) already running"<br/>continue<br/><br/>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] Apache重负荷服务器应如何优化]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>