Sie sind auf Seite 1von 4

Scott Forsyth's Blog

Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.
Why is the IIS default app pool recycle set to 1740
minutes?
Microsoft IIS Server as !at a""ears to be an odd defa#lt for te a""lication "ool recycle time. It defa#lts
to $%&' min#tes, !ic is e(actly )* o#rs. I+ve al!ays been a bit c#rio#s !ere tat defa#lt came from. If
yo#+re li,e me, yo# may ave !ondered too.
Wonder no longer- Wile at te M.P S#mmit tis year in /ellev#e WA I ad te "rivilege again of tal,ing
!it te IIS team. Wade 0ilmo !as tere too. Someo! in te conversation a disc#ssion abo#t IIS defa#lt
settings came #", !ic incl#ded te odd $%&' min#tes for te a"" "ool recycle interval. Wade told te
story of o! te setting came into being, and e granted me "ermission to sare.
As yo# can imagine, many decisions for te large set of "rod#cts "rod#ced by Microsoft come abo#t after a
lot of deliberation and researc. 1ters ave a gee,y and f#n origin. Tis is one of te latter.
The 1740 story
/ac, !en IIS 2 !as being develo"ed3!ic is te version tat introd#ced a""lication "ools3a defa#lt
needed to be set for te Regular Time Interval !en a""lication "ools are a#tomatically recycled.
Wade s#ggested )* o#rs for te sim"le reason tat its the smallest prime number over 24. 0e !anted
a staggered and non4re"eating "attern tat doesn+t occ#r more fre5#ently tan once "er day. In Wade+s
!ords6 7yo# don+t get a resonate "attern8. Te defa#lt as been $%&' min#tes 9)* o#rs: ever since-
Tat+s a f#n little tidbit on te origin of te $%&'. 0o! abo#t in yo#r environment to#g; Wat is a good
defa#lt;
ractical guidelines
<irst off, I tin, )* o#rs is a good defa#lt. <or a sit#ation !ere yo# don+t ,no! te environment, !ic is
te case for a defa#lt setting, aving a non4resonate "attern greater tan one day is a good idea.
0o!ever, since yo# li,ely ,no! yo#r environment, it+s best to cange tis. I recommend setting to a fi(ed
time li,e &6''am if yo#+re on te East coast of te =S, $6''am on te West coast, or !atever seems to
ma,e sense for yo#r a#dience !en yo# ave te least amo#nt of traffic. Setting it to a fi(ed time eac day
Why is the IIS default app pool recycle set to 1740 minutes? - Scott Forsyth... http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default...
1 de 4 05/08/2013 10:01 a.m.
d#ring lo! traffic times !ill minimi>e te im"act and also allo! yo# to tro#blesoot easier if yo# r#n into
any iss#es. If yo# ave m#lti"le a""lication "ools it may be !ise to stagger tem so tat yo# don+t overload
te server !it a lot of sim#ltaneo#s recycles.
Note tat IIS overla"s te a"" "ool !en recycling so tere #s#ally isn+t any do!ntime d#ring a recycle.
0o!ever, in4memory information 9session state, etc: is lost. See tis video if yo# !ant to learn more abo#t
IIS overla""ing a"" "ools.
?o# may as, !eter a fi(ed recycle is even needed. A daily recycle is @#st a band4aid to fresen IIS in case
tere is a sligt memory lea, or anyting else tat slo!ly cree"s into te !or,er "rocess. In teory yo#
don+t need a daily recycle #nless yo# ave a ,no!n "roblem. I #sed to recommend tat yo# t#rn it off
com"letely if yo# don+t need it. 0o!ever, I+m leaning more today to!ards setting it to recycle once "er day
at an off4"ea, time as a "roactive meas#re.
My reason is tat, first, yo#r site so#ld be able to s#rvive a recycle !ito#t too m#c im"act, so recycling
daily so#ldn+t be a concern. Secondly, I+ve fo#nd tat even !ell beaving a"" "ools can event#ally ave
someting snea, in over time tat im"acts te a"" "ool. I+ve seen iss#es from traffic "atterns tat ca#se
e(cessive cacing or someting odd in te a""lication, and I+ve seen te very rare IIS b#g 9rare indeed-:
tat isn+t a "roblem if recycled daily. Is it a band4aid; Possibly, b#t if a daily recycle ,ee"s a non4critical
iss#e from b#bbling to te to" ten I believe tat it+s a good "roactive meas#re to save a lot of
tro#blesooting effort on someting tat "robably isn+t im"ortant to tro#blesoot. 0o!ever, if yo# tin, yo#
ave a real iss#e tat is being s#""ressed by recycling ten, by all means, t#rn off te a#to4recycling so tat
yo# can trac, do!n and resolve yo#r iss#e. Tere+s no blac, and !ite ans!er. 1nly yo# can ma,e te best
decision for yo#r environment.
Idle Time!out
Wile on te to"ic of a"" "ool defa#lts, tere is one more tat yo# so#ld cange !it every ne! server
de"loyment. Te Idle Time-out so#ld be set to ' #nless yo# are doing b#l, osting !ere yo# !ant to ,ee"
te memory foot"rint "er site as lo! as "ossible.
If yo# ave a @#st a fe! sites on yo#r server and yo# !ant tem to al!ays load fast ten set tis to >ero.
1ter!ise, !en yo# ave )' min#tes !ito#t any traffic ten te a"" "ool !ill terminate so tat it can start
Why is the IIS default app pool recycle set to 1740 minutes? - Scott Forsyth... http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default...
2 de 4 05/08/2013 10:01 a.m.
#" again on te ne(t visit. Te "roblem is tat te first visit to an a"" "ool needs to create a ne! !A!".e(e
!or,er "rocess !ic is slo! beca#se te a"" "ool needs to be created, ASP.NET or anoter frame!or,
needs to be loaded, and ten yo#r a""lication needs to be loaded. Tat can ta,e a fe! seconds. Terefore I
set tat to ' every cance I ave, #nless it+s for a server tat osts a lot of sites tat don+t al!ays need to be
r#nning.
Tere are oter settings tat can be revie!ed for eac environment b#t te t!o aforementioned settings are
te t!o tat so#ld be canged almost every time.
0o"ef#lly yo# en@oyed ,no!ing abo#t te )* o#r defa#lt as m#c as I did, even if @#st for f#n. 0a""y
IISing.
Posted6 A"r '2 )'$A, $)6'2 PM by 1WScott B !it * comment9s:
<iled #nder6 IIS, Performance T#ning, IIS%, Windo!s Server, IISC
"omments
Leniel Macaferi said6
Scott,
Dreat reading- 6:
Setting te idle time o#t to ' !as someting I learned te ard !ay. eee
/est,
Leniel
E A"ril 2, )'$A C6F% PM
Pa#l Lync said6
Tan,s Scott 4 I ad al!ays !ondered abo#t tat odd )* o#rs and no! it does ma,e sense.... 64:
Pa#l
E A"ril $F, )'$A &6F* AM
Gevin Hice said6
<irst time I sa! I)* o#rsI I immediately recogni>ed it as "rime and int#itively ,ne! te reason. Pera"s, it so#ld be )* o#rs, $%
min#tes; Dood ti" on idle time4o#t.
E A"ril )*, )'$A )6AF PM
1WScott said6
JGevin Hice, yo# ave a good int#ition ten. I li,e te )*K$%, or even )*L% min#tes !ic is $&&%M te first "rime n#mber 9from te
min#tes "ers"ective: after $&&'. Tere are a fe! f#n o"tions to coose from.
E A"ril )*, )'$A C6$* PM
/ill said6
0o! does te a"" "ool beave if yo# ave bot te defa#lt a"" "ool to recycle every $%&' min#tes and a s"ecific time of day daily;
E May $F, )'$A $)6&F AM
1WScott said6
Why is the IIS default app pool recycle set to 1740 minutes? - Scott Forsyth... http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default...
3 de 4 05/08/2013 10:01 a.m.
0i /ill,
Te $%&' is a time since te last recycle, so te daily recycle !o#ld occ#r before $%&' co#ld occ#r, essentially ca#sing te $%&' to not be
#sed.
Te time interval setting co#ld be #sed !it te daily recycle if itIs less tan )& o#rs 9e.g. &rs:. I canIt tin, of many reasons to do so,
b#t itIs "ossible.
E May $F, )'$A *6)$ PM
D Nillon said6
1nce again Tan,s Scott 64:
E O#ne $), )'$A C6'2 PM
Anicet said6
0i Scott,
for some reason te A"" "ool is recycling itself t#s ,illing my Session variables. Wat co#ld be ca#sing te A"" "ool to recycle by itself;
And is tere any tool yo# may ,no! tat I may #se to monitor te A"" "ool beavior;
Tan,s.
E O#ne $C, )'$A $6&$ PM
1WScott said6
0i Anicet,
Tis can be ca#sed by recycling te a""lication "ool, or recycling te a"" domain. ?o# can tell if te a""lication "ool as been recycled by
!atcing te PIN in tas, manager 9add te PIN col#mn: and seeing if te PIN canges. If te recycle is at te a""domain level ten itIs
more !or, fig#ring o#t te ca#se.
Tere are a fe! tings tat can ca#se li,e, li,e an #nealty "age tat ca#ses te a"" "ool to fail, a"" "ool limits being reaced 9li,e
memory or time:, or sim"ly creating folders on dis, or ma,ing canges to !eb.config 9tese !ill ca#se a""domain recycles:.
In IIS%L yo# can edit te PHecycling...P feat#re for te a""lication "ool and in te )nd ste" of te !i>ard yo# can t#rn on all H#ntime
recycling events. Ten after te ne(t recycle yo# so#ld see a log of it in Event .ie!er. TereIs no real dra!bac, to doing tis e(ce"t
some more catter in Event .ie!er 9#s#ally very minimal:. If yo# lose session state b#t te PIN doesnIt cange on te a"" "ool ten itIs
an a""domain recycle instead.
IIve !ritten a co#"le blog "osts tat e("lain tis f#rter6
!eblogs.as".netK...Ka""lication4vs4a""domain.as"(
!eblogs.as".netK...KASP.NET4v).'4Q)N''Q4A""Nomain4recyclesQ)R''Q4more4common4tan4before.as"(
E O#ly $*, )'$A F6&* PM
Terms of =se
Why is the IIS default app pool recycle set to 1740 minutes? - Scott Forsyth... http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default...
4 de 4 05/08/2013 10:01 a.m.