Detailed explanation of IIS application pool and AppPool recycle page 1/2

Source: Internet
Author: User

Because applications in the application pool are separated from other applications by working process boundaries, applications in an application pool will not be affected by problems caused by applications in other application pools.

Windows 2003 supports two working modes at the same time. The default is ISS 6.0 Working Process Isolation Mode. Working Process Isolation Mode prevents one application or site from being stopped and affects another application or site, greatly enhancing the reliability of IIS. So how to set two working modes?

Start IIS manager, right-click the website, and select "properties" to open the Properties dialog box (figure 1 ).

In IIS 6.0 Working Process Isolation Mode, all application code runs in the isolation environment. How are they isolated? In Windows 2003, an application pool is added. The working process isolation mode allows you to create multiple application pools. Each application pool can have different configurations. Because these application pools receive their requests directly from the kernel rather than the WWW Service, the performance and reliability are enhanced. To isolate Web applications running on the same computer but belonging to different websites, you need to create a separate application pool for each website.

Create application pool

In IIS manager, open the local computer, right-click application pool, and choose new application pool (the application pool can be created only in Working Process Isolation Mode ). In the application pool Name box, enter a new application pool name. If the ID (for example, AppPool #1) that appears in the "application pool ID" box is not what you want, you can rename it. If you click "use existing application pool as template", right-click the application pool you want to use as the template in the "application pool name" box. Click [OK].

Assign application pool

In IIS manager, right-click the application for which you want to assign an application pool, and then click Properties ". Click the "home directory" tab to confirm whether the "Application name" of the directory or virtual directory you are assigning has been filled in. If the "Application name" box is not yet filled, click "CREATE" and enter a name.

In the application pool list box, select the name of the application pool you want to assign to it. Click [OK].

  Let's take a look at some questions about the application pool. The "properties" dialog box of the application pool has four pages: recycle, performance, running status, and ID, as shown in figure 6. Among these option pages, the most striking is probably the "recycle" page, which can be used to manage the collection of worker processes. In working process Isolation Mode, IIS can be configured to regularly restart the working processes in the application pool to better manage those working processes with errors. This ensures that the applications in the pool run normally and the lost system resources can be recovered. In order to recycle the worker process, the failure Worker Process's ability to receive requests will be limited until it processes all the remaining requests stored in the Request queue. To discharge the current request, you can restrict the Process configuration. The replacement Worker Process of the same namespace group starts before the old worker stops to prevent service interruption. The old process completes its pending requests and closes normally, or if it reaches the configured time limit, number of requests, the set time schedule, or when it reaches the specifiedMemoryIf the application is still disabled, the process is terminated explicitly. By default, the application pool is recycled every 1740 minutes (29 hours.

W3SVC checks whether the application pool runs properly based on the options on the "running status" page, including pinging the Worker Process at specified times, in seconds, the default value is 30 seconds. (The worker must start within the specified time period) whether to enable quick failure protection (if a certain number of worker processes fail within the specified period of time, the application pool is disabled ). In addition, ISAPI applications (includingASP. NET and asp. dll) can declare that they are no longer suitable for providing services and require recycling.

By default, When IIS 6.0 recycles a pool, it uses a recycling technology called overlapped recycle. In this recycle mode, failed worker processes remain running and a new worker process is created. IIS 6.0 passes the new incoming request to the new working process, but does not remove the old working process until the old Working Process completes the request in its queue or encounters a timeout error. During this period, TCP/IP connections will not be lost because http. sys maintains the connection validity. When a failed working process times out and fails, the next request sent to the working process is a new request, so the session information originally stored in the process will be lost. All such recycling operations are performed automatically without administrator intervention. In most cases, service interruption is not caused. If necessary, set the value of LogEventOnRecycle to 1, indicating that an event log is generated when W3SVC executes the recycle operation.

For applications that cannot run on multiple instances, overlapped recycle recycling technology may cause problems. If you encounter such problems, you can set the value of DissallowOverlappingRotation to True (1) to disable the process "overlapping" during the recycle operation of an application pool. In addition, for failed working processes, we may not want to remove them, but keep the process to detect and find the root cause of the problem, in this case, you can set the configuration data attribute OrphanActionExe to the name of the execution file, so that the execution file remains running when the process becomes "Orphan.

Another feature related to the application pool is that IIS 6.0 allows you to configure an application pool as a Web Garden ). To understand the concept of Web garden, we can imagine a situation where there is an IIS 5.0 server and three Web sites, each of which runs the same application, if IIS 5.0 is able to automatically send requests to the equivalent and actually isolated Web websites based on the circular loop mode and separate the loads to three different processes, A small Web Farm-Web Farm.

In the IIS 6.0 Web garden, you do not need to create additional Web sites. You only need to specify the number of worker processes used in an application pool. The specific configuration steps are as follows: Open the "properties" dialog box of the application pool and go to the "performance" page, in the "Maximum number of worker processes" input box under "Web Garden", enter the number of processes, eight. When the server load is small and no additional working process is required, IIS 6.0 is after a certain period of time (20 minutes by default, configurable) automatically reduces the actual number of worker processes. If the load increases, additional worker processes are required. IIS 6.0 increases the number of worker processes again. All these operations are performed automatically without administrator intervention.

Figure 6

Two new configuration data attributes: SMPAffinitze and SMPAffinitzeCPUMask -- allows you to configure a specific processor assigned to a worker: Setting the SMPAffinitized attribute to true indicates that the specific Worker Process assigned to the application pool should be assigned to a specificCPUThe SMPProcessorAffinityMask attribute is used to configure the hex processor mask. The hex processor mask specifies which Worker Process in the application pool should be bound.CPU.

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.