How to Schedule Recycling an IIS Application Pool

How to Schedule Recycling an IIS Application Pool

  •  
  •  
  •  
  •  
  •  
  •  

We have a customer with an IIS 6.0 application that crashes randomly–either the Application Pool worker process runs the server out of memory or hangs.

If you have a need to recycle the Application Pool between scheduled maintenance intervals, there are a couple of available solutions.

Windows 2003 (IIS 6)

You can do it via script or the user interface.

IISApp.vbs

This script is part of the Windows 2003 Platform. Windows 2003 SP1 introduced the ability to recycle application pools. The syntax is pretty easy:

cscript.exe <path>\IISApp.vbs /a /r

Save this into a batch file and drop it into the task scheduler.

Application Pool Recycling through IISAdmin

  1. On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. Expand the server name, and then click Application Pools.
  3. Right-click &gt; Properties on the Application Pool you wish to recycle.
  4. Set the appropriate properties for recycling.

    For example, to recycle the worker processes at 6AM, select the “Recycle worker processes at the following times” checkbox and enter the appropriate time (24-hour format).
  5. Click OK.

Windows 2008 (IIS 7)

You can schedule IIS App pool recycling through the IIS admin console in Windows 2008 as well.  The interface is very different, but the concept is the same:

  1. On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In the Connections pane, expand the server name, and then click Application Pools.
  3. In the Application Poolspane, select the application pool you wish to edit.
  4. In the Actions pane, click Recycling…
  5. On the Recycling Conditions page of the Edit Application Pool Recycling Settings Wizard, select at least one of the options in the Fixed Intervals section, select the checkboxes and enter values for “Regular time intervals” or “Specific Times” as necessary, and then click Next.
  6. Click Finish.

Published by Aaron Guilmette

Helping companies conquer inferior technology since 1997. I spend my time developing and implementing technology solutions so people can spend less time with technology. Specialties: Active Directory and Exchange consulting and deployment, Virtualization, Disaster Recovery, Office 365, datacenter migration/consolidation, cheese.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.