Research on IIS6 application pool Configuration

Source: Internet
Author: User
Tags metabase

When the website cannot be accessed, You can manually recycle the application pool to restore it. However, manual recovery is very troublesome. You cannot stare at this website all day? If the problem lies in the application pool, we can check whether the problem can be solved by configuring the application pool.

1. Create an application pool for each website separately. An application pool will be used at the "command prompt" for different w3wp.exe processes.Iisapp commandYou can check the PID value of w3wp.exe corresponding to the website to locate the problematic process.

2. Application pool Configuration
In my opinion, the configuration of the "recycle" and "running status" tabs is important in the Properties window of the application pool.

2.1 recyclingTab

1. recycling process (minutes ):The number of minutes after which the worker node recycles the worker node. It is enabled by default and set to 1740 minutes (29 hours );
2. Reclaim the Working Process (number of requests ):The number of HTTP requests processed by a worker to terminate the worker. This parameter is disabled by default. If it is enabled, the default value is 35000;
3. Reclaim the working process at the following time:The process is disabled by default at the specified time. If you want to enable it, you can click the Add button to add a time for recycling. You can set a 24-hour time for recycling;
4. Reclaim the worker process when too much memory is consumed:
Maximum virtual memory (MB ):When the virtual memory used by a worker reaches the set value, the worker 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 is disabled by default. If enabled, the default value is 192 mb. We recommend that you set the value to no more than 60% of the total physical memory;

2.2 Performance

1. Close the Working Process (minutes) after idle for this period of time ):When a worker is idle for several minutes, it is disabled. This reduces the consumption of system resources and CPU performance by idle workers. The default value is 20 minutes. 2 \; x7 j "I # s5 k + X

2. The core Request queue is limited to (number of requests ):When
When HTTP. 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 saves the received request
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
The limit is to retain 1000 requests. If the limit is exceeded, a 503 error is returned to the client. You can modify the limit as needed. The maximum value is 65535. However, setting too large will consume a lot
System resources. setting too small may cause frequent 503 errors during client access.

2.3. Running status

1. Enable Ping:By default, the application pool is set to every 30
Second, Ping the worker process. When the worker process does not respond, it is deemed that the worker process has a fault and is configured to shut down by default. You can modify the Ping interval, but it is too long.
The Ping interval may cause Web service interruption. A too short Ping interval consumes more system resources and CPU utilization. Therefore, we recommend that you retain the default configuration;
2. 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.
3. Start time limit:IIS waits for the start time of the worker process that belongs to the application pool. When the start time of the Worker Process exceeds the set value, IIS records the event log;
4. Closing 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.

Different settings are available in different situations.

The following describes the optionsWorking principle:

The application pool has the followingTwo ways to recycle work processesHowever, neither of the two recycling methods 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 on the IIS console.
Modify the DisallowOverlappingRotation metabase attribute of the corresponding application pool in metabase. xml to true.

The w3wp.exe process will be closed before being recycled, and memory will be released, resulting in the loss of session connection from the client. The user who needs to log on will log out of the current connection and log on again. Therefore, we cannot perform the "recycle" Operation frequently, to avoid frequent login troubles;

The CPU usage of the secondary node reaches 100%. In addition, the excessive number of connections causes the IIS service to be suspended and the website cannot be accessed.

For this reason, the iisquestion should be handled in response to this internal question. For w3wp.exe, CPU usage is 100%. We can restrict 4th items in "recycle", and for IIS false dead often occur on machines, we can set them in items 1, 2, and 3;

Specific configuration case:

My website is inaccessible from time to time recently. Sometimes it is an internal error of 500. Sometimes it does not respond after half a day of access, check the event logs on the server and find that the message "the process that provides service for the application pool 'apppool # 1' has been shut down for a period of time that exceeds the limit" is displayed ", manually "recycle" the application pool corresponding to the website and restore to normal.

Set an application pool for this service website and set the application pool based on the traffic characteristics of my servers.

I. Recycling

1. recycling process (minutes): 5 minutes. The process of generating a large number of votes will be completed in a timely manner;

2. Reclaim the Worker Process (number of requests): (not selected) it can be used if you can count the number of Worker Process requests, but it seems difficult to count.

3. Recycle the working process at the following time: I set it to A.M.. In fact, there are fewer visits at this time, and the recycle process does not make much sense.

4. Collect the worker process when too much memory is consumed: (optional) the worker can be used when w3we.exe occupies a high CPU.

Ii. Performance

Idle Timeout: 5 minutesWhen the time for recycling a worker process in "recycle" is smaller than this value, it will be changed to the default value of "recycle Worker Process (minutes) = 60 minutes, idle timeout = 60 minutes

Request queue limit: 1000 (default)

The maximum number of worker processes in the WEB garden is 1 (default ). Changes to this value may cause some websites to be inaccessible.

Iii. Running status

Enable ping: select

Enable quick failure protection: No. This is the easiest way to enable IIS to run on the machine.

Start time limit: 90 seconds

Closing time limit: 90 seconds

Http://hi.baidu.com/0wem/blog/item/c3ed892681f62f1c8a82a13e.html

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.