IIS App Pool recycling settings

Modified on Thu, 31 Mar, 2022 at 5:16 PM

The Problem 

By default, IIS will recycle the Application Pool every day, usually in the early hours of the morning. When this happens ManagementSutiod is unloaded from memory and the Task Scheduler is interrupted until a user logs into ManagementStudio and IIS loads ManagementStudio back into memory. This behaviour has the side effect of breaking scheduled tasks that are scheduled early in the morning before users have logged into the system.


The Solution

IIS can be configured to reload an application back into memory after the Application Pool has been recycled. This keeps the Task Schuelder running and allows scripts to be scheduled to run early in the morning before users would have logged into ManagementStudio. 


Step Summary

  1. Install the Application Initialization Module
  2. Ensure the Application Pool is set to start immediately 
  3. Set as Always Running and Idle Timeout = 0
  4. Set the Recycling Time to 2 am
  5. Set Preload Enabled to true


Step by Step Guide


Step 1. Install the Application Initialization Module

The Application Initialization module is installed via the Server Manager. You can find the module under Server Roles -> Web Server (IIS) -> Application Development -> Application Initialization.


Step 2. Ensure the Application Pool is set to start immediately

  1. Select the Application Pool ManagementStudio is running under
  2. Click Basic Settings... from the Actions panel
  3. Ensure Start application pool immediately is enabled
  4. Click OK



Step 3. Set Always Running and Idle Timeout

  1. Select the Application Pool ManagementStudio is running under
  2. Click Advanced Settings... from the Actions panel
  3. Set Start Mode to AlwaysRunning
  4. Set Idle Time-out (minutes) to 0
  5. Click OK



Step 4. Set the Recycling Time

  1. Select the Application Pool ManagementStudio is running under
  2. Click Recycling... from the Actions panel
  3. Set a recycle time out of normal working hours. e.g. 2:00 AM
  4. Untick all other recycling options
  5. Click Next and then Finish



Step 5. Preload ManagementStudio

  1. Select the ManagementStudio Website or Application.
  2. Click Advanced Settings... from the Actions panel
  3. Set Preload Enabled to True
  4. Click OK