Who has not encounterd this problem: you’re just doing some debugging on your favorite SharePoint application and all over sudden – bam! The application pool gets recycled.
Well, the problem is the timeout associated with each application pool. When IIS detects that an application pool is not responding anymore IIS just assumes something terrible happend and recycles the application pool. But all that really happend is some plain-old-debugging.
In order to circumvent this problem you have to disable the pinging of application pools by IIS. Just open up the advanced settings of the IIS application pool and set pinging to false.
Up to Windows 2008 there was a nifty little VB-Script called
iisapp.vbs. This allowed to just restart the application pool without having to restart the whole IIS. For one this is much faster and also this doesn’t effect other application pool. Thus you can restart a single application.
But with Windows 2008 this script is no longer provided. But fortunatly there is a new kid in town:
appcmd.exe. This tool can be found in
To restart (recylce) an application pool you just call:
c:\Windows\System32\inetsrv\appcmd recycle apppool "SharePoint - 80"
Starting with IIS 7.5 (Windows 7, Windows 2008 R2) application pools can be started with the help of an IIS module. This module issues web-requests whenever a new worker-process is being started. This eliminitates the need for additional warmup-scripts.
A more detailed describtion on how to use this module can be found at Using the IIS Application Warm-Up Module.
I just stumpled across the offical Microsoft IIS Site, which I didn’t actually knew so far. This is a great resource for IIS, especially if your looking for security or performance related addons for IIS.