对于 ASP.NET 在 IIS 上的一些高并发处理配置
1、配置应用程序池:
队列长度:65535(尽可能的长)
固定时间间隔:1440分钟(24小时)
闲置超时:0分钟(不超时)
2、防火墙:
禁止 wcf 端口的外部访问(net.tcp,同时禁用元数据获取)
3、IIS配置:
应用程序并发请求限制:c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000
手动:
C:\Windows\System32\inetsrv\config\applicationHost.config
<serverRuntime appConcurrentRequestLimit="100000" />
4、.NET 请求队列大小和工作线程池大小:
文件:
notepad %systemroot%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
notepad %systemroot%\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
修改:
<system.web>
<processModel enable="true" requestQueueLimit="100000" maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50" minIoThreads="50"/>
...
<system.web>
5、系统连接限制:
reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000
输了你,赢了世界又如何...