How Worker Process Recycling Works in IIS 6.0

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

Depending on how an application pool is configured for recycling, the World Wide Web Publishing Service (WWW service) in IISĀ 6.0 can recycle the assigned worker process in two ways:

  1. By default, the WWW service establishes an overlapped recycle, in which the worker process that is to be terminated is kept running until after a new worker process is started.

  2. Alternatively, the WWW service can terminate a worker process and then start a new worker process if the workload justifies this action.

Note

When the WWW service recycles a worker process, it does not disconnect the existing TCP/IP connection. The HTTP protocol stack (HTTP.sys) establishes and maintains TCP/IP connections.

In an overlapped recycle scenario, the process that is targeted for a recycle continues to process requests while the WWW service simultaneously creates a replacement worker process. The new worker process is started before the old worker process stops, and requests are then directed to the new process. This design prevents service interruptions, because the old process remains in communication with HTTP.sys to handle requests until it shuts down. Because the shutdown timeout value of an overlapped shutdown or startup is configurable, the worker process can be terminated while it is still serving requests, if it does not finish draining requests within the time limit.

When you configure an application pool to recycle worker processes based on elapsed time, all the worker processes are recycled during the elapsed time set, but they are not recycled all at once. Application recycling is spread over the time set to reduce interruptions of service to client requests.

Similarly, when you configure an application pool to recycle applications based on the number of requests processed, recycling takes place at intervals to spread the overhead that is associated with the worker-process recycling.