让Win2008+IIS7+ASP.NET支持10万并发请求-创新互联

由于之前使用的是默认配置,服务器最多只能处理5000个同时请求,今天下午由于某种情况造成同时请求超过5000,从而出现了下面的错误

专注于为中小企业提供网站制作、成都网站制作服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业平遥免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了成百上千家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

Error Summary:

HTTP Error 503.2 - Service Unavailable
The serverRuntime@appConcurrentRequestLimit setting is being exceeded.

Detailed Error Information:

Module IIS Web Core
Notification BeginRequest
Handler StaticFile

Error Code 0x00000000

为了避免这样的错误,我们根据相关文档调整了设置,让服务器从设置上支持10万个并发请求。

具体设置如下:

1. 调整IIS 7应用程序池队列长度

由原来的默认1000改为65535。

IIS Manager > ApplicationPools > Advanced Settings

Queue Length : 65535

2. 调整IIS 7的appConcurrentRequestLimit设置

由原来的默认5000改为100000。

c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000

在%systemroot%\System32\inetsrv\config\applicationHost.config中可以查看到该设置: 

复制代码代码如下:

 

3. 调整machine.config中的processModel>requestQueueLimit的设置 machine.config位置  %systemroot%\Microsoft.Net\Framework64\v2.0.50727\CONFIG\machine.config
由原来的默认5000改为100000。 

复制代码代码如下:



 

参考文章:http://technet.microsoft.com/en-us/library/dd425294(office.13).aspx

4. 修改注册表,调整IIS 7支持的同时TCPIP连接数

由原来的默认5000改为100000。 

复制代码代码如下:

reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000 

完成上述4个设置,就可以支持10万个并发请求,博客园博客服务器已经启用上述设置。

参考文章:

IIS 7.0 503 errors with generic handler (.ashx) implementing IHttpAsyncHandler

Tuning Windows Server 2008 for PHP

To modify the ASP.NET request queue limit

  1. Click Start and then click Run.

  2. In the Run dialog box, type notepad %systemroot%\Microsoft.Net\Framework64\v2.0.50727\CONFIG\machine.config, and then click OK.

  3. Locate the processModel element that looks like this: 

  4. Replace the processModel element with the following value: 

  5. Save and close the Machine.config file.

  6. For Windows Server 2008, in the Run dialog box, type appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:<#of users * 1.5>.

创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。


分享名称:让Win2008+IIS7+ASP.NET支持10万并发请求-创新互联
浏览地址:http://ybzwz.com/article/shhpi.html