简体   繁体   中英

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?...)

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 .

  • First, look for <healthMonitoring> in the master web.config

  • Inside the healthMonitoring node, find the <rules> node

  • Inside rules, add the following:

     <add name="Application Lifetime Events Default" eventName="Application Lifetime Events" provider="EventLogProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" /> 

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.

Try looking in the EventLog. When the app pool recycles, there is an entry written to the log along with the reason.

The following link describes the errors codes you'll see in the eventlog for IIS 7.5 http://technet.microsoft.com/en-us/library/dd349270(WS.10).aspx

If there are not already log entries in your troubled machine's event viewer, you can modify IIS to log all app pool recycles.

Article from Microsoft on how to do it is found below

http://support.microsoft.com/kb/332088

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM