We are tracing a connection leak in an application that uses remoting hosted in IIS so to clear orphaned connections we have scheduled an AppPool recycle at specified times of the day.
However I’m not seeing evidence that this recycle is happening according to the schedule –
I have changed the metabase property so IIS will log all recycles and it does log manual recycle commands.
What might be stopping IIS from observing the schedule?
When you do an application pool recycle (on a scheduled basis), a new worker process (
w3wp.exe) is started. The existing worker process is kept alive to service existing requests and then shut down when there are no more. All new requests are sent to the new worker process.You can check to see if the application pool you are recycling is a new
w3wp.exeprocess. You can do this by using the following IIS admin script:Make a note of the process ID’s before and after the scheduled recycle time to see if they change.
You may need to use:
cscript iisapp.vbsif cscript isn’t your default WSH script host.When an application pool recycles you should also see the following event in your system event log:
This event will appear after the number of minutes specified in the
Idle timout(Application Pool properties -> Performance tab) plus the length of time it takes for the existing worker process to complete any pending requests and the last ASP.NET application domain is torn down (existing ASP.NET sessions will be serviced by the old worker process until there are no more).