Anda di halaman 1dari 7

Recommended tweaks for IIS 8.

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.

Keep your application pools warm

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

Set a daily application pool recycle schedule

The general recommendation is still to periodically recycle application pools


despite the fact that there is an argument to be made to not do this, as it
potentially hides/mitigates underlying memory leaks that really should just be
fixed in the first place! The default application pool recycle period configured in
IIS is set to every 1740 minutes (29 hours). However, I prefer to change this to a
specific time each day so that the application pools are not potentially recycled
during a period of peak use. Again, in either Advanced Settings for a specific

application or in Application Pool Defaults, we can configure a schedule by


changing the following settings:
Regular Time Intervals (minutes): Change to 0
Specific Times: Specify a time as appropriate. In the example below, Ive
configured my application pools to be recycled at 4am:

Log application pool recycle events

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

Manual Recycle: Change to True


Request Limit Exceeded: Change to True
Specific Time: Change to True

1. Control Application Pool Recycling

IIS7 Recycling Options

In my opinion the biggest source of problems in new IIS configurations is Application


Pool Recycling. This is the one area where the default IIS settings are problematic for
most applications. As a general rule of thumb, you want to minimize the number of
Recycles that occur, and when they do occur it should be well controlled. Heres what
you need to look at:
Application Pool Idle Timeout The default is 20 minutes, if your app gets no requests in
20 minutes then the App Pool will shut down. Change this 0.
Regular Time Interval The default is 1740 minutes, every 29 hours the App Pool will
recycle, regardless of activity. You dont want that happening, set this to 0.
Specific Times By default no schedule is set, I would recommend setting an off peak
time to recycle like 4AM.
Most importantly, because I constantly see developers and administrators doing
this. Stop using IISReset!! A lot of people cling to this idea from IIS 5, and it only
destabilizes your environment. Unless your installing ISAPI Filters or other System level
change, you dont need an IISReset. Recycle the App Pool in question if its needed, but
do not restart IIS.
Set Performance Counter on the server to monitor the below Queue:
Performance Counters:
"HTTP Service Request queue" and then select the pool you like to monitor.

Anda mungkin juga menyukai