The settings below are for IIS 8.5 on Windows Server 2012 R2, but many of them
are applicable to older versions of IIS as well.
By default, IIS will shut down an application pool after 20 minutes of inactivity.
This results in a noticeable delay when first accessing any web site(s) configured
to use this application pool, as it needs to start up again and load itself back into
memory. The same is true after IIS is restarted for whatever reason (e.g.
following a server reboot). We can change this behavior for a specific Application
Pool in Advanced Settings or make it apply to all Application Pools in the
Application Pool Defaults settings. The changes we need to make are as follows:
Start Mode: Change to AlwaysRunning
Idle Time-out (minutes): Change to 0
By default, IIS will not log in event viewer when it recycles application pool(s) on
a schedule. But it is a good thing to know, not least so we can be sure it is
actually recycling the pools! You can set what is logged in event viewer by
changing the following settings under the Generate Recycle Event Log
Entry settings section in Advanced Settings or Application Pool Defaults:
Isapi Reported Unhealthy: Change to True