IIS – WarmUp the Sites on startup

So I have been tuning the crap out of IIS since 5.1 (believe me that was work).

I have always ran into issues with web services taking a few seconds to minutes warming up.

Warming up is defined by just that site has to load memory and profile identity. Calls are made and it seems like forever to get a status page.

So in my lengthy investigation into getting IIS to do a warmup auto-magically.

I have tuned every dang thing I can.

C:\Windows\System32\inetsrv\config\applicationHost.config



<sites>

<site name=”MySite” id=”1″>

<application path=”/” serviceAutoStartEnabled=”true” serviceAutoStartProvider=”PreWarmMyCache” />

</site>

</sites>

<serviceAutoStartProviders>

<add name=”PreWarmMyCache” type=”PreWarmCache, MyAssembly” /></serviceAutoStartProviders>

<applicationPools><add name=”MyAppWorkerProcess” managedRuntimeVersion=”v4.0″startMode=”AlwaysRunning” />

</applicationPools>


 

This enables both admins and Developers to warm-up the web apps/services.

Credit to ScottGu


 

Don’t forget the next fun thing…

 

The Machine.config is located in the .net framework. So it can be very touchy. You’ve been warned.


 

<runtime>
<generatePublisherEvidence enabled=”false”/>
</runtime>

Credit:Amol Ravande’


 

And finally a warm script if your afraid of heavy tweaking…

'My Version:
'Section for writing into a text file
Const FORAPPENDING = 8
strFileName = "C:\Utils\service_status.txt"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objTS = objFS.OpenTextFile(strFileName,FORAPPENDING)
objTS.WriteLine Hget

‘Site1
site1=”http://localhost/default.asmx”
‘Site 2
site2=”http://localhost/default.aspx”

‘strUserID = Inputbox(“Enter your UserID : . . .”,strUSERID, “AMDopp”)
‘strPassword = Inputbox(“Enter your password : . . .”,strPassword, “”)

Function WarmUp(url)
On Error Resume Next
Dim objHTTP
Set objHTTP = CreateObject(“Microsoft.XMLHTTP”)
objHTTP.Open “GET”,url,False
objHTTP.Send()
If Err.Number=0 And objHTTP.Status=200 Then
Hget=url & “Has been warmed up successfully at : ” & Now()
wscript.echo ” Has been warmed up : “, hget=url
Else
Hget=url & “Found error at : ” & Now()
wscript.echo “Found Error at : “, hget=url
End If

Set objHTTP = Nothing

End Function

WarmUp(site1)
WarmUp(site2)

copy paste name it <something>.vbs

Go forth and make the internets faster at least IIS websites.

This entry was posted in Uncategorized. Bookmark the permalink.