Health Monitoring in .NET 2.0
The app I have been working on has started to experience some weird issues on our new production server. The users are getting prompted for log in credentials while they are working. Normally that only happens when they are idle for 20 minutes. But the users have assured me this will happen within 5 minutes of them logging in. I checked all of the normal stuff, like making sure the default time out wasn't anything ridiculously small, or the worker process wasn't set to recycle every 3 minutes or something. Those were all normal.So I started looking around the internet and I wasn't the only one having this strange problem with IIS6 on a windows 2003 server. It seems that for some reason my app was randomly restarting. But in order to confirm this I had to add some health monitoring for my app. Which is actually some pretty cool stuff.
The code itself is pretty simple (see below) and what it will do is let you know when any application event is happening (stopping, starting, halted that kinda thing). And it will add all of this neatly into the windows event viewer. All you need to do is add the code below to the
<healthmonitoring><rules> section of the global web.config file.
<add name="Application Lifetime Events Default" eventname="Application Lifetime Events" provider="EventLogProvider" profile="Default" mininstances="1" maxlimit="Infinite" mininterval="00:01:00" custom="" />The above code is only using default .Net stuff. I was hoping for a few more events that I could add that would give me a better picture of what was happening, but it seems that there are only a few in-built ones that you can use. The rest you have to build yourself. I haven't looked into doing, but you can find how to here.
So I just need to let that run for a few days and see if my session time outs line up with my app restarts.
Labels: .NET
posted by Tom Becker at
4/14/2008
![]()

0 Comments:
Post a Comment
<< Home