Posts tagged ‘Managing Application Pools’

Managing Application Pools

When you run IIS 6.0 in worker process isolation mode, you can separate different Web applications and Web sites into groups known as application pools. An application pool is a group of one or more URLs that are served by a worker process or set of worker processes. Any Web directory or virtual directory can be assigned to an application pool.

A worker process is user-mode code whose role is to process requests, such as processing requests to return a static page, invoking an ISAPI extension or filter, or running a Common Gateway Interface (CGI) handler.

Every application within an application pool shares the same worker process. Because each worker process operates as a separate instance of the worker process executable, W3wp.exe, the worker process that services one application pool is separated from the worker process that services another. Each separate worker process provides a process boundary so that when an application is assigned to one application pool, problems in other application pools do not affect the application. This ensures that if a worker process fails, it does not affect the applications running in other application pools.

Use multiple application pools when you want to help ensure that applications and Web sites are confidential and secure. For example, an enterprise organization might place its human resources Web site and its finance Web site on the same server, but in different application pools. Likewise, an ISP that hosts Web sites and applications for competing companies might run each company’s Web services on the same server, but in different application pools. Using different application pools to isolate applications helps prevent one customer from accessing, changing, or using confidential information from another customer’s site.

Application Pool Actions:

To manage Application Pools go to IIS Manager and click on application pool which you want to configure for recycling.

Tab and their descriptions:

Element Name Description
Add Application Pool Opens the Add Application Pool dialog box from which you can add an application pool to the Web server.
Set Application Pool Defaults Opens the Application Pool Defaults dialog box from which you can set default values that apply to all application pools that you add to the Web server.
Start Starts the selected application pool.
Stop Stops the selected application pool. This causes the Windows Process Activation Service (WAS) to shut down all running worker processes serving that application pool. An administrator must restart a stopped application pool or else requests made to applications in that application pool will receive HTTP 503-Service Unavailable errors.
Recycle Stops and restarts the selected application pool. Restarting an application pool causes the application pool to be temporarily unavailable until the restart is complete.
Basic Settings Opens the Edit Application Pool dialog box from which you can edit the settings that were specified when the application pool was created. This action is available only when an item is selected from the list on the feature page.
Recycling Opens the Edit Application Pool Recycling Settings wizard from which you can specify conditions under which to recycle an application pool and configure how recycling events are logged.
Advanced Settings Opens the Advanced Settings dialog box from which you can configure advanced settings for the selected application pool.
Rename Enables the Name field of the selected application pool so that you can rename the application pool.
Remove Removes the item that is selected from the list on the feature page.
View Applications Opens the Applications feature page from which you can view the applications that belong to the selected application pool.

Edit Application Pool Recycling Settings:

Use the Recycling Conditions page of the Edit Application Pool Recycling Settings Wizard to configure IIS to periodically restart worker processes in an application pool. This can help you to recover valuable system resources and to better manage faulty worker processes.

Tab and their descriptions:

Element Name Description
Regular time intervals (in minutes) Select this option to specify a time interval, in minutes, at which you want IIS to recycle the worker process. You might choose this option if you have an application that causes problems when it runs for an extended time. Based on what you know about the application, you should set the value to be less than the length of time elapsed before application failure.
Fixed number of requests Select this option to specify the number of requests after which you want IIS to recycle the worker process. You might choose this option if you have an application that causes problems after reaching a certain number of requests. Based on what you know about the application, you should configure the value to be less than the number of requests processed before application failure.
Specific time(s) Select this option to specify a time or times at which you want IIS to recycle the worker process in a 24-hour period. For example, to recycle a worker process at 4:30 A.M. and 4:30 P.M., enter 4:30 AM, 4:30 PM. The time that you specify uses the local time on the Web server. You might choose this option if you have an application that causes problems when it runs for an extended time and you want to recycle the application pool at a specific time, such as a time that is late at night or early in the morning, to avoid a negative impact on users. Based on what you know about the application, you should set the interval to be frequent enough to prevent application failure.
Virtual memory usage (in KB) Select this option to specify the maximum number of kilobytes of your system’s common virtual memory that can be used by a worker process before that process is recycled. You might choose this option when you notice a steady increase in the virtual memory used on your server. This might indicate that an application reserves memory multiple times, which fragments the memory heap. Entering too high a value can severely decrease system performance. At first, you should set the virtual memory threshold to be less than 70 percent of available virtual memory, and then adjust the setting if you have to.
Private memory usage (in KB) Select this option to specify the maximum number of kilobytes of privately allocated system physical memory that can be used by a worker process before the process is recycled. You might choose this option when you have an application that leaks memory. Entering too high a value can severely decrease system performance. At first, you should set this value to be less than 60 percent of the available physical memory on the server, and then adjust this setting if you have to.

Recycling Events to Log:

Use the Recycling Events to Log page of the Edit Application Pool Recycling Settings Wizard to configure IIS to log an event when a worker process is recycled.

You can configure IIS to log information for recycling events that you configure, such as at a fixed interval or for recycling events that occur at runtime, such as when an ISAPI declares itself unhealthy.

Tab and their descriptions:

Element Name Description
Regular time intervals Select this option to log an event when a worker process is recycled at a specified time interval. This option is available only when the Regular time intervals (in minutes) option is selected and a time interval is specified on the previous wizard page.
Virtual memory usage Select this option to log an event when a worker process is recycled after using a specified amount of virtual memory. This option is available only when the Virtual memory usage (in KB) option is selected and a number of kilobytes is specified on the previous wizard page.
Number of requests Select this option to log an event when a worker process is recycled after reaching a specified number of requests. This option is available only when the Fixed number of requests option is selected and a number of requests is specified on the previous wizard page.
Scheduled time(s) Select this option to log an event when a worker process is recycled at a specified time. This option is available only when the Specific time(s) option is selected and a time is specified on the previous wizard page.
Private memory usage Select this option to log an event when a worker process is recycled after using a specified amount of physical memory. This option is available only when the Private memory usage (in KB) option is selected and a number of kilobytes is specified on the previous wizard page.
On-demand Select this option to log an event when you recycle a worker process by using IIS Manager or Appcmd.exe to correct a problem.
Configuration changes Select this option to log an event when a change to configuration causes the application pool to recycle.
Unhealthy ISAPI Select this option to log an event when an ISAPI extension reports to the worker process that it is unhealthy.





P.S. : Thanks to Kranti.