Common settings that support highly concurrent IIS Web servers

Source: Internet
Author: User
Tags config servervariables time interval

Applicable IIS version: IIS 7.0, IIS 7.5, IIS 8.0

Applicable versions of Windows: Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

1, the application pool (application pool) settings:

General->queue length set to 65535 (maximum supported for queue Length) Process Model->idle time-out set to 0 (does not allow application pools to be reclaimed because no requests are made) Recycling->r Egular time interval set to 0 (disable application pool for periodic automatic recycling)

2. Net framework-related settings

A) in Machine.config

<processmodel autoconfig= "true"/>

To

<processmodel enable= "true" requestqueuelimit= "100000"/>

(This setting takes effect immediately after saving)

b) Open C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers\Default.browser and find <defaultbrowser id= " WML "parentid=" "Default", find <defaultbrowser id= "WML" parentid= "default", Comment <capabilities> part, Then run aspnet_regbrowsers-i on the command line.

<defaultbrowser id= "Wml" parentid= "Default" >
    <identification>
        

To solve the TEXT/VND.WAP.WML problem.

3, IIS applicationhost.config settings

To set the command:

C:\windows\system32\inetsrv\appcmd.exe Set config/section:serverruntime/appconcurrentrequestlimit:100000

To set the result:

<serverruntime appconcurrentrequestlimit= "100000"/>

(This setting takes effect immediately after saving)

4, the HTTP.sys setting

Registry Settings Command 1 (set the maximum number of connections to 100,000):

REG ADD hklm\system\currentcontrolset\services\http\parameters/v maxconnections/t reg_dword/d 100000

Registry Settings Command 2 (resolve bad request-request Too long problem):

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

(You need to run net stop HTTP & net start HTTP & IISReset on the command line to make the settings effective)

5, for the load balancing scene settings

Add the following rule in the 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>

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/web/

Related posts: request.userhostaddress Records IP address problems encountered after moving into Aliyun

6. Set Cache-control as Public

Add the following configuration to the web.config:

<configuration>
    <system.webServer>
        <staticContent>
            <clientcache cachecontrolcustom= "public"/>
        </staticContent>
    </system.webServer>
</ Configuration>

Author: cnblogs Dudu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.