When and How to Use Worker Process Recycling

Applies To: Windows Server 2003, Windows Server 2003 with SP1

Consider the following guidelines when you decide whether to enable worker process recycling. Worker process recycling is not intended as a replacement for fixing a faulty application; however, recoding is not always an option, especially in cases when other application code is running that cannot be modified.

Consider using recycling in these situations:

  • Your Web server hosts faulty applications that you cannot fix.

  • Your Web server is experiencing undetermined or intermittent problems.

  • Performance monitoring suggests that an application is leaking memory.

  • You have implemented a temporary reset solution, such as a scheduled execution of the IISReset utility or a scheduled restart.

You might not need to use recycling in these situations:

  • You are hosting a Web site that contains static content only and no custom ISAPI applications.

  • You are hosting an application that is thoroughly tested and does not have memory or resource allocation issues.

To effectively use recycling, see Table 3.6, which presents the criteria on which recycling can be based.

Table 3.6   When to Use Each Recycling Option

Recycle Trigger Timing of Recycling Conditions for Use

ISAPI unhealthy request

Recycles based on a request from an ISAPI extension in an application pool.

An ISAPI extension is built to declare itself unhealthy and pinging is enabled.

Elapsed time

Recycles after a specified number of minutes.

Applications cannot run for extended time periods.

Number of requests

Recycles when the number of HTTP requests exceeds a specified number of requests.

Applications fail because of the quantity of requests that they receive.

Scheduled times

Recycles at specified times within a 24-hour period.

Applications cannot run for an extended time period, or you want to periodically refresh applications during times of low use, such as on weekends or during late evening and early morning.

Virtual memory

Recycles when the worker process virtual memory (reserved plus used) reaches a specified maximum.

The memory heap becomes fragmented, which is caused by applications reserving memory multiple times. A steady increase in the use of virtual memory can indicate a fragmented memory heap.

Used memory

Also called private memory. Recycles when the memory that is used by the worker process reaches a specified maximum.

Some applications have memory leaks.

User demand

Recycles when you use IIS Manager to manually recycle all the worker processes in an application pool, or when you run a script that calls the Recycle() method for the application pool.

A single application is causing problems while other sites are running, and you need to act quickly. Consider recycling the application pool instead of resetting the entire WWW service.

For additional information about configuring worker processes for recycling, see Recycling Worker Processes with IIS 6.0, which provides detailed instructions for recycling worker processes immediately or based on the following criteria: elapsed time, number of processing requests, scheduled time, and maximum memory used.