• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
  • Advanced search options...
Tags
  • .NET Framewor
  • .NET Framework
  • Ajax/Javascript
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

LogParser did it again: application pool recycle

MSDN Blogs > Never doubt thy debugger > LogParser did it again: application pool recycle

LogParser did it again: application pool recycle

Rate This
Carlo Cardella
29 Jul 2008 4:26 AM
  • Comments 1

This started as a “standard” w3wp.exe crash, but this time IIS was also randomly disabling one of the application pools on the server. This is a protection mechanism we have since IIS 6 called Rapid Fail Protection that disables ad application pool (for security and stability reasons) if it fails (encounters severe errors) too often: how often and how much time it’s configurable (see Configuring Rapid-Fail Protection in IIS 6.0), the default is 5 failures in 5 minutes.

Looking at the System event log there were plenty of messages like:

A worker process with process id of 'xxx' serving application pool 'MyAppPool' has requested a recycle because it reached its virtual memory limit.

And also:

A process serving application pool 'MyAppPool' exceeded time limits during shut down. The process id was 'xxx'.

How often? As usual, LogParser comes at hand.

logparser 
    "select quantize(TimeGenerated, 300) as TimeGen, count(*) as NumberOfrecycles
    into memory_limit_recycles.log from system.evt 
    where EventID = 1077 and Message like '%\'MyAppPool%' group by TimeGen order by TimeGen" 
    -i:evt -o:nat -rtp:-1

Note the “quantize” function: LogParser help states “Truncates a value to the nearest multiple of another value”; what it actually does in the command above is count the number of recurrences of a certain event in “blocks” of 5 minutes (300 seconds in my sample).

The output is something like:

Generated           NumberOfRecycles 
------------------- ----------------
2008-07-06 21:55:00 5
2008-07-06 22:00:00 5
2008-07-06 22:05:00 5
2008-07-06 22:10:00 4
2008-07-06 22:15:00 4
2008-07-06 22:20:00 3
2008-07-06 22:25:00 1
2008-07-06 22:30:00 2
2008-07-06 22:35:00 1
2008-07-06 22:40:00 2
2008-07-06 22:45:00 1
2008-07-06 22:50:00 2
2008-07-06 22:55:00 1
2008-07-06 23:00:00 2
2008-07-06 23:05:00 1
2008-07-06 23:10:00 2
2008-07-06 23:15:00 1
2008-07-06 23:20:00 2
2008-07-06 23:25:00 1
2008-07-06 23:30:00 2
2008-07-06 23:35:00 3
[...]

As you can see the pool is recycled quite often, event 4-5 times every 5 minutes, exactly the default limit configured for pool heal checking in IIS… Moreover we don’t have to forget about the second error message:

logparser 
    "select quantize(TimeGenerated, 300) as TimeGen, count(*) as ShutDownLimit into ShutDownLimit.log 
    from system.evt where Message like '%\'MyAppPool%' and Message like '%exceeded time limits during shut down%' 
    group by TimeGen order by TimeGen" -i:evt -o:nat -rtp:-1

And the output is:

TimeGen             ShutDownLimit 
------------------- -----
2008-07-09 09:05:00 3
2008-07-09 10:00:00 5
2008-07-11 14:40:00 3
2008-07-15 10:50:00 5
2008-07-15 11:30:00 3
2008-07-15 13:00:00 3
2008-07-15 14:45:00 3
2008-07-15 14:50:00 4
2008-07-15 14:55:00 3
2008-07-15 16:15:00 3
2008-07-15 16:20:00 4
2008-07-15 16:40:00 3
2008-07-15 16:45:00 3
2008-07-15 17:00:00 3
2008-07-15 17:25:00 3
2008-07-15 17:30:00 3
2008-07-15 17:40:00 3
2008-07-15 17:45:00 3
2008-07-15 17:55:00 3
2008-07-15 18:00:00 4

Sometimes we’re clearly exceeding the configured pool health checking so really no surprise IIS disables it.

But why the pool is recycled so often? Well, we found a mistake in customer’s configuration: the application pool was configured to be recycled when the virtual memory reached 50 Mb, definitely a value too low. Increasing it to resolved also this problem: no more pool recycles and as obvious side effect the users noticed an increased stability and performance when working with the application.

 

Carlo

Quote of the day:
A wise man gets more use from his enemies than a fool from his friends. - Baltasar Gracian
  • 1 Comments
ASP.NET, LogParser
Leave a Comment
  • Please add 8 and 6 and type the answer here:
  • Post
Comments
  • Ran Davidovitz
    2 Aug 2008 9:11 AM

    This is a very nice use of Log parser, this is the first time I see the usage of "quantize" - nice!

Page 1 of 1 (1 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223