Configure Application Pool Recycling

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

Internet Information Services (IIS) can be configured to periodically restart worker processes assigned to an application pool, which recycles faulty Web applications. Recycling keeps problematic applications running smoothly, especially when it is not feasible to modify the application code. Recycling helps ensure that problematic applications do not cause other applications to fail, and that system resources can be recovered from unhealthy applications. Use the Configure Application Pool Health procedure earlier in this appendix to configure worker process shutdown and startup times to ensure that applications do not experience downtime.

Requirements

  • Mode: This feature of IIS 6.0 is available only when IIS is running in worker process isolation mode.

  • Credentials: Membership in the Administrators group on the local computer.

  • Tools: Iis.msc.

Recommendation

As a security best practice, log on to your computer using an account that is not in the Administrators group, and then use the Run as command to run IIS Manager as an administrator. At the command prompt, type **runas /user:**administrative_accountname mmc %systemroot%\system32\inetsrv\iis.msc.

Procedures

To recycle a worker process immediately on demand

  1. In IIS Manager, expand the local computer.

  2. Expand Application Pools.

  3. Right-click the appropriate application pool you want to recycle, and then click Recycle.

To configure a worker process to be recycled after a set elapsed time

  1. In IIS Manager, expand the local computer, and expand Application Pools.

  2. Right-click the application pool you want to configure, and then click Properties.

  3. On the Recycling tab, select the Recycle worker processes (in minutes) check box.

  4. In the text box to the right of the Recycle worker processes (in minutes), type the number of minutes that you want to elapse before the worker process is recycled, and then click OK.

To configure a worker process to be recycled after a set number of processing requests

  1. In IIS Manager, expand the local computer, and expand Application Pools 

  2. Right-click the application pool you want to configure, and then click Properties.

  3. On the Recycling tab, select the Recycle worker process (number of requests) check box.

  4. In the text box to the right of the Recycle worker process (number of requests), type the number of requests to be processed before the worker process is recycled, and then click OK.

To configure a worker process to be recycled at scheduled times

  1. In IIS Manager, expand the local computer, expand Application Pools.

  2. Right-click the application pool you want to configure, and then click Properties.

  3. On the Recycling tab, select the Recycle worker processes at the following times check box.

  4. Click Add to add a time to the list, Remove to delete a time, or Edit to change an existing time when the worker process is recycled, and then click OK.

    Note

    When recycling is set to occur at scheduled times, it may occur off-schedule if the system time is manually altered. To avoid unintended changes in the time that recycling occurs, recycle the scheduled worker processes soon after the system time is changed.

To configure a worker process to be recycled after consuming a set amount of memory

  1. In IIS Manager, expand the local computer, and expand Application Pools.

  2. Right-click the application pool you want to configure, and then click Properties.

  3. On the Recycling tab, under Memory recycling, select the Maximum virtual memory (in megabytes) check box.

  4. In the text box to the right of Maximum virtual memory (in megabytes), type the maximum amount of virtual memory allowed before the worker process is recycled.

  5. Select the Maximum used memory (in megabytes) check box.

  6. In the text box to the right of Maximum used memory (in megabytes), type the maximum amount of memory allowed before the worker process is recycled, and then click OK.