IIS Web服务器支持高并发设置
2014-03-17 13:45
323 查看
适用的IIS版本:IIS 7.0, IIS 7.5, IIS 8.0
适用的Windows版本:Windows Server 2008, Windows Server 2008 R2, Windows Server 2012
1、应用程序池(Application Pool)的设置:
General->Queue Length设置为65535(队列长度所支持的最大值)
Process Model->Idle Time-out设置为0(不让应用程序池因为没有请求而回收)
Recycling->Regular Time Interval设置为0(禁用应用程序池定期自动回收)
2、.Net Framework相关设置
a) 在machine.config中将
<processModel autoConfig="true" />
改为
<processModel enable="true" requestQueueLimit="100000"/>
(保存后该设置立即生效)
b)
打开C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers
\Default.browser,找到<defaultBrowser id="Wml" parentID="Default"
>,注释<capabilities>部分,然后运行在命令行中运行aspnet_regbrowsers -i。
<defaultBrowser id="Wml" parentID="Default" >
<identification>
<header name="Accept" match="text/vnd\.wap\.wml|text/hdml" />
<header name="Accept" nonMatch="application/xhtml\+xml; profile|application/vnd\.wap\.xhtml\+xml" />
</identification>
<!--
<capabilities>
<capability name="preferredRenderingMime" value="text/vnd.wap.wml" />
<capability name="preferredRenderingType" value="wml11" />
</capabilities>
-->
</defaultBrowser>
以解决text/vnd.wap.wml问题。
3、IIS的applicationHost.config设置
设置命令:
c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000
设置结果:
<serverRuntime appConcurrentRequestLimit="100000" />
(保存后该设置立即生效)
4、http.sys的设置
注册表设置命令1(将最大连接数设置为10万):
reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000
注册表设置命令2(解决Bad Request - Request Too Long问题):
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters /v MaxFieldLength /t REG_DWORD /d 32768
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters /v MaxRequestBytes /t REG_DWORD /d 32768
(需要在命令行运行 net stop http & net start http & iisreset 使设置生效)
5、针对负载均衡场景的设置
在Url Rewrite Module中增加如下的规则: 代码如下:
<rewrite>
<allowedServerVariables>
<add name="REMOTE_ADDR" />
</allowedServerVariables>
<globalRules>
<rule name="HTTP_X_Forwarded_For-to-REMOTE_ADDR" enabled="true">
<match url=".*" />
<serverVariables>
<set name="REMOTE_ADDR" value="{HTTP_X_Forwarded_For}" />
</serverVariables>
<action type="None" />
<conditions>
<add input="{HTTP_X_Forwarded_For}" pattern="^$" negate="true" />
</conditions>
</rule>
</globalRules>
</rewrite>
6、 设置Cache-Control为public
在web.config中添加如下配置:
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" />
</staticContent>
</system.webServer>
</configuration>
http://www.jb51.net/list/list_204_1.htm
适用的Windows版本:Windows Server 2008, Windows Server 2008 R2, Windows Server 2012
1、应用程序池(Application Pool)的设置:
General->Queue Length设置为65535(队列长度所支持的最大值)
Process Model->Idle Time-out设置为0(不让应用程序池因为没有请求而回收)
Recycling->Regular Time Interval设置为0(禁用应用程序池定期自动回收)
2、.Net Framework相关设置
a) 在machine.config中将
<processModel autoConfig="true" />
改为
<processModel enable="true" requestQueueLimit="100000"/>
(保存后该设置立即生效)
b)
打开C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers
\Default.browser,找到<defaultBrowser id="Wml" parentID="Default"
>,注释<capabilities>部分,然后运行在命令行中运行aspnet_regbrowsers -i。
<defaultBrowser id="Wml" parentID="Default" >
<identification>
<header name="Accept" match="text/vnd\.wap\.wml|text/hdml" />
<header name="Accept" nonMatch="application/xhtml\+xml; profile|application/vnd\.wap\.xhtml\+xml" />
</identification>
<!--
<capabilities>
<capability name="preferredRenderingMime" value="text/vnd.wap.wml" />
<capability name="preferredRenderingType" value="wml11" />
</capabilities>
-->
</defaultBrowser>
以解决text/vnd.wap.wml问题。
3、IIS的applicationHost.config设置
设置命令:
c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000
设置结果:
<serverRuntime appConcurrentRequestLimit="100000" />
(保存后该设置立即生效)
4、http.sys的设置
注册表设置命令1(将最大连接数设置为10万):
reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000
注册表设置命令2(解决Bad Request - Request Too Long问题):
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters /v MaxFieldLength /t REG_DWORD /d 32768
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters /v MaxRequestBytes /t REG_DWORD /d 32768
(需要在命令行运行 net stop http & net start http & iisreset 使设置生效)
5、针对负载均衡场景的设置
在Url Rewrite Module中增加如下的规则: 代码如下:
<rewrite>
<allowedServerVariables>
<add name="REMOTE_ADDR" />
</allowedServerVariables>
<globalRules>
<rule name="HTTP_X_Forwarded_For-to-REMOTE_ADDR" enabled="true">
<match url=".*" />
<serverVariables>
<set name="REMOTE_ADDR" value="{HTTP_X_Forwarded_For}" />
</serverVariables>
<action type="None" />
<conditions>
<add input="{HTTP_X_Forwarded_For}" pattern="^$" negate="true" />
</conditions>
</rule>
</globalRules>
</rewrite>
6、 设置Cache-Control为public
在web.config中添加如下配置:
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" />
</staticContent>
</system.webServer>
</configuration>
http://www.jb51.net/list/list_204_1.htm
相关文章推荐
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- [转]支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置--实现10万个并发请求
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持10W高并发请求的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- IIS Web服务器支持高并发设置方法详解
- 支持高并发的IIS Web服务器常用设置
- 支持高并发的IIS Web服务器常用设置
- Win7的IIS配置asp.net出现“由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面。”(图文解决方法)
- 让服务器iis支持.apk文件下载的设置方法
- IIS 之 Web 服务器上的 ASP.NET 进程模型设置
- 个人试验可以的IIS支持解释PHP,JSP语言设置,打造全能服务器