10萬併發,IIS服務器部署疑問

正在部署幾臺WEB服務器,

其中一臺WEB服務器IIS配置:

32GB 內存,雙核心。[能否滿足?若跑在VM中,WEB服務器動態內存可否?]


10萬併發,調整如下:

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

適用的Windows版本:Windows Server 2008, Windows Server 2008 R2, Windows Server 2012


1、應用程序池(Application Pool)的設置: 

應用程序池-Classic.NET.AppPool-高級設置-隊列長度

  • General-<Queue Length設置爲65535(隊列長度所支持的最大值)

  • Process Model-<Idle Time-out設置爲0(不讓應用程序池因爲沒有請求而回收)

  • Recycling-<Regular Time Interval設置爲0(禁用應用程序池定期自動回收)

2、.Net Framework相關設置

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\

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>


3.IIS的applicationHost.config設置

設置命令CMD

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、 設置Cache-Control爲public
<configuration>
   <system.webServer>
       <staticContent>
           <clientCache cacheControlCustom="public" />
       </staticContent>
   </system.webServer></configuration>
6.ASP.NET

線程設置

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\

在machine.config的<processModel>中添加如下設置: <processModel enable="true" maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50" minIoThreads="50"/>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章