Configure the IIS application pool

Source: Internet
Author: User
Tags metabase

The core of IIS 6 isWorking Process Isolation ModeThe application pool defines how the worker process works. Therefore, the application pool is the core of IIS 6.

Different from IIS 5, you can only use a single application pool.Working Process Isolation ModeYou can create multiple application pools in IIS 6. Different application pools are completely isolated. When an application pool stops service, it does not affect other application pools.

Before using the application pool, you should determine the number of application pools you need. Many may think that since different application pools are completely isolated, I only need to create an application pool for each web site. This method can be used when there are a small number of Web sites on the IIS server. However, if there are many web sites on the IIS server, this method is not applicable, because different application pools create their own working processes when they are accessed, a large number of working processes consume a large amount of system resources and CPU utilization when working concurrently, this reduces server performance. You should divide the web sites on the IIS server based on the importance, isolation, and security and stability of the running code, then, determine the number of application pools as needed. For those very important websites, websites that need to be isolated separately, websites that run code stability and security are not reliable, they are configured to use their own independent application pool, other common web sites are configured to use a public application pool.

By default,Default websiteAnd createDefaultapppoolThe application pool under the default configuration can work well. We recommend that you configure the application pool only when necessary.

 

Configure application pool Properties

Expand in the IIS ConsoleApplication poolFolder, right-click the corresponding application pool, and clickAttributeYou can perform the following configuration in the properties of the application pool:

Reclaim

InReclaimTag, you can set the collection method of the Worker Process:

  • Recycle Working Process (minutes): The number of minutes after a worker runs, Which is disabled by default and set to 1740 minutes (29 hours );

  • Reclaim worker processes (number of requests): The number of HTTP requests processed by a worker to terminate the worker. This is disabled by default. If it is enabled, the default value is35000;

  • Reclaim the working process at the following time: The worker process is disabled by default at the specified time. To enable the process, select the task and click Add to add the recycle time. You can set the recycle time in 24 hours;

  • When too much memory is consumed, recycle the Worker Process:

    • Maximum virtual memory (MB): When the virtual memory used by the worker process reaches the set value, the recycle worker process is disabled by default. If enabled, the default value is 500 mb. We recommend that you set the value to 70% of the total virtual memory;

    • Maximum memory used (MB): When the physical memory used by a worker reaches the set value, the worker process is recycled. disabled by default. If enabled, the default value is 192 mb. We recommend that you set the value to 60% of the total physical memory;

In addition, the application pool has the following two ways to recycle working processes, but neither of them will interrupt Web Services:

  • By default, the application pool usesOverlap collectionMethod. In this way, when the application pool needs to shut down a working process, a working process is created first until the new working process is successfully created;

  • The application pool can also shut down the old working process and then create a new working process.

If the web application does not support running multiple instances, you must configure the application pool to prohibit overlap collection. This configuration cannot be modified in the IIS console. You can only modify the disallowoverlappingrotation metabase attribute of the corresponding application pool in metabase. XML to true.
 

 

Performance

InPerformanceLabel, you can set the running mode of the Worker Process:

  • Shut down the working process after idle time (minutes): How many minutes after a worker is idle, disable the worker. This reduces the consumption of system resources and CPU performance by idle workers. The default value is 20 minutes;

  • The core Request queue is limited to (number of requests): When HTTP. when sys receives an HTTP request from a client, if the worker process of the corresponding application pool processing the request is still busy, HTTP. sys stores the received requests in the Request queue of the corresponding application pool until the worker process is idle. This option is used to set the number of requests that the request queue of this application pool can accommodate. By default, the request queue of each application pool is limited to reserved1000If the number of requests exceeds the limit, the system returns the 503 error to the client. You can modify the value as needed. The maximum value can be set65535. However, setting too large will consume a lot of system resources, and setting too small will cause frequent 503 errors during client access.

  • Enable CPU monitoring: Monitors the CPU usage of this application pool, which is not enabled by default. If an application pool occupies too many CPU usage, you can configure this option to limit this application pool;

    • Maximum CPU usage (percentage): The maximum CPU usage that can be used by the Set application pool; The default value is 100 when CPU monitoring is enabled;

    • Refresh CPU usage (minutes): Interval for refreshing CPU usage. The default value is 5 when CPU monitoring is enabled;

    • Operation performed when the CPU usage exceeds the maximum usage: The operation performed when the CPU usage of this application pool exceeds the set maximum CPU usage. When CPU monitoring is enabled, the default value isNoneIn this case, IIS only records the event log, and does not perform other operations. If you selectClose, IIS will close all worker processes in this application pool;

  • Web Park: InWeb ParkYou can configure the maximum number of worker processes used by the application pool. The default value is 1 and the maximum value is 4000000; configuring multiple worker processes can improve the performance of the application pool to process requests. However, before you configure multiple worker processes, consider the following:

    • Every working process consumes system resources and CPU usage. Too many working processes will lead to a sharp consumption of system resources and CPU usage;

    • Each worker process has its own status data. If a web application depends on a worker process to save status data, multiple worker processes may not be supported.

 

 

Running status

InRunning statusTag you can configure the application pool to monitor the running status of the worker process,

  • Enable Ping: By default, the application pool is configured to ping the worker process every 30 seconds. When the worker process does not respond, the worker process is deemed to be faulty and disabled by default. You can modify the ping interval, but too Long Ping interval may cause web service interruption, and too short Ping interval will consume more system resources and CPU utilization, therefore, we recommend that you retain the default configuration;

  • Enable quick Failure Protection: If there is a problem with writing the web application code, it may cause the work process to continue to have problems. By default, the application pool is configured to enable quick failure protection. When the worker process is configured for a period of time (5 minutes by default) if the number of failures in the application exceeds the configured value (5 by default), the application pool is disabled.

  • Start Time Limit: The time when IIS waits for the worker process that belongs to the application pool to start. When the Worker Process activation time exceeds the set value, IIS will record it in the event log;

  • Close Time Limit: When IIS detects a worker process failure, it marks the worker process as disabled. This option specifies the time limit for IIS to wait for the Worker Process to automatically close, if the worker process is not closed after the time limit is exceeded, IIS forcibly closes the worker process.

 

 

Identifier

InIdentifierTag, you can configure the user account that the workflow runs. When IIS 5 or IIS 6 runs in IIS 5 Isolation Mode, the worker process runs inLocal SystemAccount, and run inWorking Process Isolation ModeIIS 6 running inNETWORK SERVICEAccount, which reduces the possibility of system attacks.

You can configure the worker to run in the predefinedLocal System,Local ServiceOrNETWORK SERVICEYou can also use a Custom User Account. We recommend that you use the defaultNETWORK SERVICEBut for higher security, you can configure a user account. However, we recommend that you add this userIis_wpgUser Group, soIis_wpgThe user group has the minimum permissions to start and run a working process.

 

 

Create application pool

To create an application pool, right-click on the IIS ConsoleApplication poolFolder, pointingNew, SelectApplication pool;

ThenAdd new application poolDialog box, inApplication pool IDEnter the application pool name in the column, select whether to use the default settings or inherit the existing application pool settings, and then clickOKYou can;

 

 

Allocate a web site to the application pool

Expand in the IIS ConsoleWebsiteFolder, right-click the corresponding website, and selectAttributeIn the pop-up website Properties dialog box, clickMain directoryLabel, and thenApplication poolSelect different application pools. By default, all applications used by the website are namedDefault ApplicationIf you want to use different application names for this websiteApplication nameBar, for example, here I changeWinsvrAnd clickOKYou can,

In this case, the application of the corresponding website is displayed under the corresponding application pool, as shown in:

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.