About Process Recycling

Overview

IIS allows applications to be run out-of-process (OOP) hosted by a DLLHost.exe process which is isolated from IIS. Process recycling leverages the infrastructure built by COM+ to perform process recycling of these OOP applications. Specifically, IIS relies on the RecycleProcess() method in COM+ as a means of indicating to COM+ that applications hosted by a DLLHost.exe process should be recycled. For more information about when you may want to recycle an application, see Problems with Applications.

Problems with Applications

Over time applications often see their performance degrade due to poorly written code, sometimes getting stuck in a loop that causes unnecessary load on the CPU. These applications can also cause memory leaks, where applications do not release un-needed memory back to the operating system. These applications can cause a server to stall, requiring the server to be re-booted. Process recycling was created to solve these problems.

How Process Recycling Works

Process recycling works by recycling an application or pool of applications when a configured reycling event occurs. The methodology behind recycling an OOP application is simple; IIS calls into the COM+ RecycleProcess() method requesting that the application's DLLhost.exe hosting process be recycled. When a recycling event is triggered, the following events happen:

For more information about the COM+ RecycleProcess, search for the keyword "RecycleProcess" in the COM+ (Component Services) Platform SDK.

Pooled and Isolated Applications

Applications can be configured to run in one of three ways. IIS 5.0 introduced the terminology "isolation level" to describe these options. The three isolation levels are Low, Medium, and High: Applications are configured on the Home Directory property sheet using the IIS snap-in.

The levels of the metabase that Process Recycling can be configured are explained in Levels and Inheritance. For information about configuring process recycling, see Configuring Process Recycleng Events. For more information about running an application in-process or out-of-process, see About Applications

Recycling Events

There are three events that can be configured to trigger a recycling event, all of which can be active simultaneously. These events are as follows:

Summary of Process Recycling Events

Listed below are the metabase key names that can be configured to trigger a process recycling event to occur.

Understanding Triggered Events

When more than one event is used to trigger recycling, the first event threshold that is reached causes IIS to recycle the application's DLLhost.exe process. The PeriodicRestartTime and PeriodicRestartRequests events use internal timers that count from zero to the value set in their metabase key. When the counter reaches the value set in the metabase key, the process is recycled, and the internal counter is set back to zero. Also, the PeriodicRestartTime and PeriodicRestartRequests internal counters affect each other as shown below.

Important   The internal timers only read from the metabase, they do not reset the metabase values. Do not confuse the internal timers with the default metabase key parameters.

Note   The default metabase key parameters for the PeriodicRestartTime and PeriodicRestartRequests is zero, thereby disabling these features. The PeriodicRestartSchedule event is not configured at all by default. The Levels and Inheritance topic describes the metabase keys that are associated with Process Recycling events in detail.

For information about configuring Process Recycling events, see Configuring Recycling Events. For information about configuration levels and inheritance, see Levels and Inheritance.

Related Resources

The following resources provide related information:


© 1997-2001 Microsoft Corporation. All rights reserved.