Application pool optimal configuration scheme of IIS in IIS7 and IIS7.5

Source: Internet
Author: User

Find the application pool corresponding to the Web site, application pool → find the corresponding application pool → Right-click Advanced Settings ...

  

First, the General optimization scheme

1. Basic Settings

[1] Queue Length: Default value 1000, change the original queue length to 65535.

[2] Start a 32-bit application: The default value of False, to true, or install some 32 of the build or 32-bit PHP will be error.

[3] Managed piping mode: Integrated or Classsic.

  

2. Advanced Settings

  [1] idle timeout (minutes): default 20 minutes, modify set length.

[2] fast fault protection → enabled: Default true, to False.

  

3. Resolve PEP the first time to open pep slow

Recycle interval time

  

Using Windows Server R2 to solve the problem of recycling suspended animation

Open application pool, advanced settings, select "True" in "prevent overlapping reclamation", which effectively avoids the problem of the application pool recycling animation.

  

second, support 100,000 simultaneous requests

By optimizing the configuration of IIS7, adjusting the queue length of IIS7 application pool, the limit of requests, tcpip the number of connections, the performance of the Web server can be improved and the access of Web Access is smooth.

The site encountered the following problems:

Error Summary:

HTTP Error 503.2-service Unavailable
The [email protected] setting is being exceeded.

Detailed Error information:

Module IIS Web Core
Notification beginrequest
Handler Staticfile

Error Code 0x00000000

Because the default configuration was used before, the server can handle up to 5,000 simultaneous requests, and this afternoon, because of a situation that caused simultaneous requests exceeding 5000, the above error occurred.

To avoid such errors, we adjusted the settings according to the relevant documentation to allow the server to support 100,000 concurrent requests from the settings.

The settings are as follows:

1. Adjusting the IIS 7 application pool queue Length

Change the original queue length from the default value of 1000 to 65535. Of course here the queue length you can set according to your own access user * 1.5来, for example: There are 2000 users, here can be set to 3000 (3000=2000 user number *1.5).

2. Adjust the Appconcurrentrequestlimit settings for IIS 7

Changed from the original default of 5000 to 100000.

[1] executed in cmd:

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

[2] This setting can be viewed in%systemroot%\system32\inetsrv\config\applicationhost.config:

<serverruntime appconcurrentrequestlimit= "100000"/>

  

  

3. Adjust the settings of the Processmodel>requestqueuelimit in Machine.config

[1] Click Start, and then click Run, or Windows + R.

[2] In the Run dialog box, type Notepad%systemroot%\microsoft.net\framework64\v4.0.30319\config\machine.config, and then click OK. (Different. NET version path is different, you can choose your own currently want to set. NET version of config)

[3] Find the ProcessModel element as shown below: <processmodel autoconfig= "true"/>

[4] Replace the ProcessModel element with the following value: <processmodel enable= "true" requestqueuelimit= "15000"/>

  

[5] Save and close the Machine.config file.
Changed from the original default of 5000 to 100000.

<configuration> <system.web> <processmodel enable= "true" requestqueuelimit= "100000"/>

Reference article: http://technet.microsoft.com/en-us/library/dd425294 (office.13). aspx

4. Modify the registry to adjust the number of simultaneous TCPIP connections supported by IIS 7

Changed from the original default of 5000 to 100000. Execute in CMD:

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

  

Can be viewed in the registry

  

5. Run the command using the settings to take effect

NET stop HTTP & net start HTTP & IISReset

To complete the above 5 settings, you can support 100,000 concurrent requests, the blog Park blog Server has enabled the above settings.

In order to approach everyone with their own use, I put the above can be used with the bat operation is easy to put into a bat file inside. Save the following to run as a do.bat file, you need to do it manually

Iii. Common settings for IIS Web servers that support high concurrency

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

Applicable Windows Server version: Windows Server R2, Windows Server 2012

1. Settings for the application pool (application pools):

[1] general->queue length is set to 65535 (maximum value supported by queue Length)
[2] Process Model->idle time-out set to 0 (do not allow application pool to be reclaimed because there is no request)
[3] recycling->regular time interval set to 0 (Disable application pool periodic auto-recycle)

2.. Net framework-related settings

[1] in Machine.config
< ProcessModel autoconfig= "true"/>

Switch

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

(This setting takes effect immediately after saving)

[2] Open C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers\Default.browser, find <defaultbrowser id= " Wml "parentid=" Default ", Comment <capabilities> section, then run aspnet_regbrowsers-i on the command line. To solve the TEXT/VND.WAP.WML problem.

Set command:

C:\windows\system32\inetsrv\appcmd.exe Set config/section:serverruntime/appconcurrentrequestlimit:100000
Set the result:
< Serverruntime appconcurrentrequestlimit= "100000"/>

(This setting takes effect immediately after saving)

4. http. sys settings

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 take effect)

5. Settings for load Balancing scenarios

Add the following rule to the URL Rewrite module:

Note: Adding this URL rewrite rule causes the IIS kernel-mode cache to not work, as described in Microsoft's Pit: URL rewriting actually causes the IIS kernel-mode cache to not work.

6. Set Cache-control to Public

Add the following configuration in Web. config:

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

Add the following settings to the <processModel> in Machine.config:

< ProcessModel enable= "true" maxworkerthreads= "maxiothreads=" "minworkerthreads=" 50 "miniothreads=" >

Category: IIS

Application pool optimal configuration scheme of IIS in IIS7 and IIS7.5

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.