Windows Server 2008 R2 让IIS支持高并发

时间:2022-06-19
本文章向大家介绍Windows Server 2008 R2 让IIS支持高并发,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

IIS的默认设置只能支持很小的访问量,访问量大了(比如每秒几千)就会不响应,可以通过下面的设置使IIS支持高并发访问

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

IIS管理——>应用程序池——高级设置
队列长度:65535

2.调整IIS的appConcurrentRequestLimit设置 默认值为5000,修改为10万 在cmd中执行下面语句

c:windowssystem32inetsrvappcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000

之后可以在%systemroot%System32inetsrvconfigapplicationHost.config中查看到该设置:

<serverRuntime appConcurrentRequestLimit="100000" /> 

3.调整machine.config中的processModel>requestQueueLimit的设置 默认值5000,修改为10万

<configuration>
    <system.web>
        <processModel enable="true" requestQueueLimit="100000"/>

4.修改注册表,调整IIS 7支持的同时TCPIP连接数 默认值5000,修改为10万

reg add HKLMSystemCurrentControlSetServicesHTTPParameters /v MaxConnections /t REG_DWORD /d 100000 

5.重启服务使生效

net stop http  & net start  http & iisreset

本文作者:老徐 本文链接:https://bigger.ee/archives/29.html 转载时须注明出处及本声明