支援高併發的IIS Web伺服器常用設定

2021-09-06 10:17:45 字數 3700 閱讀 8007

適用的iis版本:iis 7.0, iis 7.5, iis 8.0

適用的windows版本:windows server 2008, windows server 2008 r2, windows server 2012

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,找到,注釋部分,然後執行在命令列中執行aspnet_regbrowsers -i。

<

defaultbrowser

id="wml"

parentid

="default"

>

<

identification

>

<

header

name

="accept"

match

="text/vnd\.wap\.wml|text/hdml"

/>

<

header

name

="accept"

nonmatch

/>

identification

>

defaultbrowser

>

以解決text/vnd.wap.wml問題。

設定命令:

設定結果:

<

serverruntime

="100000"

/>

(儲存後該設定立即生效)

4、http.sys的設定

登錄檔設定命令1(將最大連線數設定為10萬):

登錄檔設定命令2(解決bad request - request too long問題):

(需要在命令列執行 net stop http  & net start http & iisreset 使設定生效)

5、針對負載均衡場景的設定

在url rewrite module中增加如下的規則:

遷入阿里雲後遇到的request.userhostaddress記錄ip位址問題

注意事項:新增該url重寫規則會造成iis核心模式快取不工作,詳見微軟的坑:url重寫竟然會引起iis核心模式快取不工作。

6、 設定cache-control為public

在web.config中新增如下配置:

<

configuration

>

<

system.webserver

>

<

staticcontent

>

<

clientcache

cachecontrolcustom

="public"

/>

staticcontent

>

system.webserver

>

configuration

>

7、asp.net執行緒設定

在machine.config的中新增如下設定:

<

processmodel

enable

="true"

maxworkerthreads

="100"

maxiothreads

="100"

minworkerthreads

="50"

miniothreads

="50"

/>

雲計算之路-阿里雲上:從asp.net執行緒角度對「黑色30秒」問題的全新分析

8、修改tcp maxuserport限制

由預設5000改為65534,修改方法:在登錄檔 hklm\system\currentcontrolset\services\tcpip\parameters 中新增名為maxuserport,型別為dword(32-bit),值為65534(10進製)的專案並重啟計算機。

相關博文:超出tcp連線埠數限制(maxuserport)引起的伺服器問題

讓windows server 2008 + iis 7+ asp.net 支援10萬併發請求

支援高併發的IIS Web伺服器常用設定

適用的iis版本 iis 7.0,iis 7.5,iis 8.0 適用的windows版本 windows server 2008,windows server 2008 r2,windows server 2012 2 net framework相關設定 a 在machine.config中將 p...

支援高併發的IIS Web伺服器常用設定

適用的iis版本 iis 7.0,iis 7.5,iis 8.0 適用的windows版本 windows server 2008,windows server 2008 r2,windows server 2012 2 net framework相關設定 a 在machine.config中將 改...

支援高併發的IIS Web伺服器常用設定

支援高併發的iis web伺服器常用設定 適用的iis版本 iis 7.0,iis 7.5,iis 8.0 適用的windows版本 windows server 2008,windows server 2008 r2,windows server 2012 2 net framework相關設定 ...