适用的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中将
改為
(儲存後該設定立即生效)
b) 打開C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers\Default.browser,找到,注釋部分,然後運作在指令行中運作aspnet_regbrowsers -i。
以解決text/vnd.wap.wml問題。
3、IIS的applicationHost.config設定
設定指令:
c:\windows\system32\inetsrv\appcmd.exe set config /section: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中增加如下的規則:
6、 設定Cache-Control為public
在web.config中添加如下配置: