cnblogs/dcrenl/让Windows Server 2008+IIS 7+ASP.NET支持10万个同时请求.html
2024-09-24 12:43:01 +08:00

65 lines
17 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="sina_keyword_ad_area2" class="articalContent ">
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="color:rgb(17,17,17); font-family:verdana,arial; font-size:13px; line-height:23px">具体设置如下:</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">1. 调整IIS 7应用程序池队列长度</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
由原来的默认1000改为65535。</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
IIS Manager &gt; ApplicationPools &gt;Advanced Settings</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; text-indent:0px; background-color:rgb(238,238,238)">
Queue Length : 65535</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">2. &nbsp;<wbr>调整IIS7的appConcurrentRequestLimi<wbr>t设置</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
由原来的默认5000改为100000。</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; text-indent:0px; background-color:rgb(238,238,238)">
c:\windows\system32\inetsrv\appcmd.exe set config/section:serverRuntime /appConcurrentRequestLimi<wbr>t:100000</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
在%systemroot%\System32\inetsrv\config\applicationHost.config中可以查看到该设置</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
&nbsp;<wbr></p>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; background-color:rgb(245,245,245); font-family:'Courier new'; font-size:13px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); word-break:break-all; overflow-x:auto; overflow-y:auto">
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&lt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(128,0,0); font-size:13px; line-height:1.8em">serverRuntime&nbsp;<wbr></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(255,0,0); font-size:13px; line-height:1.8em">appConcurrentRequestLimi<wbr>t</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">=&quot;100000&quot;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(255,0,0); font-size:13px; line-height:1.8em">&nbsp;<wbr></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">/&gt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,0); font-size:13px; line-height:1.8em">&nbsp;<wbr></span></div>
</div>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
&nbsp;<wbr></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
&nbsp;<wbr></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">3.调整machine.config中的processModel&gt;requestQueueLimit的设置</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
由原来的默认5000改为100000。</p>
<div style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; background-color:rgb(245,245,245); font-family:'Courier new'; font-size:13px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); word-break:break-all; overflow-x:auto; overflow-y:auto">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&lt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(128,0,0); font-size:13px; line-height:1.8em">configuration</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&gt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,0); font-size:13px; line-height:1.8em"><br style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">
&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&lt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(128,0,0); font-size:13px; line-height:1.8em">system</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(255,0,0); font-size:13px; line-height:1.8em">.web</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&gt;</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,0); font-size:13px; line-height:1.8em"><br style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">
</span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,0); font-size:13px; line-height:1.8em">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>
&nbsp;<wbr>&nbsp;<wbr></span></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">&lt;</span></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(128,0,0); font-size:13px; line-height:1.8em">processModel&nbsp;<wbr></span></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(255,0,0); font-size:13px; line-height:1.8em">requestQueueLimit</span></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">=&quot;100000&quot;</span></span><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(17,17,17); font-size:13px; line-height:1.8em; background-color:rgb(238,238,238)"><span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-family:'Courier new'; color:rgb(0,0,255); font-size:13px; line-height:1.8em">/&gt;</span></span>&nbsp;<wbr>&nbsp;<wbr></div>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">4. 修改注册表调整IIS 7支持的同时TCPIP连接数</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
由原来的默认5000改为100000。</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; text-indent:0px; background-color:rgb(238,238,238)">
reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /vMaxConnections /t REG_DWORD /d 1000000&nbsp;<wbr></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
完成上述4个设置就可以<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; color:rgb(17,17,17); font-size:13px; line-height:normal; font-family:'lucida grande',verdana,arial,geneva,lucida,sans-serif; white-space:pre">支持10万个同时请求<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; color:rgb(17,17,17); font-size:14px; line-height:21px; font-family:verdana,'courier new'; white-space:normal">博客园博客服务器已经启用上述设置。&nbsp;<wbr></span></span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
&nbsp;<wbr></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<span style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px">参考文章:</span></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<a target="_blank" href="http://stackoverflow.com/questions/612242/iis-7-0-503-errors-with-generic-handler-ashx-implementing-ihttpasynchandler" target="_blank" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:underline; color:rgb(0,102,204)">IIS
7.0 503 errors with generic handler (.ashx) implementingIHttpAsyncHandler</a></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<a target="_blank" href="http://blogs.technet.com/winserverperformance/archive/2008/07/25/tuning-windows-server-2008-for-php.aspx" target="_blank" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:underline; color:rgb(0,102,204)">Tuning
Windows Server 2008 for PHP</a>&nbsp;<wbr></p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
<br>
</p>
<p style="margin-top:5px; margin-right:auto; margin-bottom:5px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-indent:0px">
本文转自:<span style="font-family:宋体,Verdana,Arial,Helvetica,sans-serif; font-size:14px; line-height:21px; color:rgb(0,0,0)"><a target="_blank" href="http://www.cnblogs.com/dudu/archive/2009/11/10/1600062.html">http://www.cnblogs.com/dudu/archive/2009/11/10/1600062.html</a></span></p>
</div>