iisapplication-end

IIS app pool recycling randomly every few seconds


I need to determine WHY the application pool is recycling. (its for no obvious reason)

Is there any way to determine this inside of the application_end sub in the global.asax file?

I have put some basic logging in there, so I know WHEN its shutting down, but I cannot tell why.

(and its nothing obvious... it just seems like every couple of requests certain operations cause the application to end. I have turned off every normal reason for recycling such as time outs, memory checks, etc, etc, etc. Same code is working fine on a different server, so I am sure its something wrong with this setup, but what?...)


Solution

  • You don't have to incur overhead to add custom logging, ASP.NET 2.0 health monitoring does the job for you. You can add the following configuration which will log events in the eventlogs with information why Application pool is restarted.

    To turn ASP.NET health monitoring ON, you can edit the "master" web.config file, normally found in %systemroot%\microsoft.net\framework\v2.0.50727\config.

    Reproduce the issue and look in the Application event log fpr a source of ASP.NET 2.0. This should log why application pool is recycled.