开发者

IIS app pool recycling randomly every few seconds

开发者 https://www.devze.com 2023-02-21 11:13 出处:网络
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 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号