When diagnosing server performance problems, the first tool I turn to is the humble Task Manager. That's usually enough to get a rough idea of where we are in the bottleneck shell game: is it CPU, Disk, Network or Memory?
But sometimes you need to dig into performance a little deeper. Then it's time to drag out Performance Monitor. I always resist doing this for as long as I can because using perfmon is like trying to sip from a fire hose: there are a zillion performance counters that produce veritable mountains of data. The .NET framework has probably a hundred .NET-specific performance counters, and that's just a tiny fraction of the available operating system performance counters. It's downright overwhelming. Where to begin?
Microsoft provides a helpful performance monitor wizard which walks you through the process of setting up a perfmon trace with default counters. Per the Wizard, that's the following:
\Cache\* \Memory\* \Network Interface(*)\* \Objects\* \Paging File(*)\* \Physical Disk(*)\* \Process(*)\* \Processor(*)\* \Redirector\* \Server Work Queues(*)\* \Server\* \System\*
Once created, the trace can be stopped, started or modified via the Computer Management / System Tools / Performance Logs and Alerts / Counter Logs interface. Here's what the default wizard-produced trace looks like:
It's perfmon gone wild!
This is way, way, WAY too much information. Let's see if we can narrow it down to some key performance counters:
Those counters should be enough to give you a general sense of whether you're dealing with a disk, memory, CPU, or network bottleneck-- without being too overwhelming.
If you need to capture more performance counters than this, I suggest switching the counter log to CSV output via the properties dialog. Then download Microsoft's excellent LogParser tool. Now you can slice, dice, and even graph the data however you like using a relatively simple SQL-like syntax.
Posted by Jeff Atwood View blog reactions
« TryParse and the Exception Tax Passphrase Evangelism »
Thanks a lot for posting this! I'm in the process of testing an ASP.NET web app prior to deploying it onto a production server. It *does* seem like there's an awful lot of available counters...it'd be nice to select a few pre-defined counter groups with a single click. Thanks again!
zonker on August 12, 2005 11:25 AMGreat post title. Can't wait for the DVD.
David Grant on August 12, 2005 12:33 PMOnce you set up your counter settings [scale, color, line thickness, etc.,] I recommend saving the settings. You can do this by right-clicking on the gray charting area and clicking "Save As..." web page. Next time you start PerfMon, simply drag this html file into the gray charting area and you're ready to go. This will prevent the PerfMon gone wild scenerio above.
PerfMon rules!
I'm eager to take a look at Log Parser - I put together a similar application.
Eldar on August 22, 2005 05:08 PMHow do you submit a command from the logparser's(2.2) command-line tool that will sql-ize the possibly plural network-interface-card(s) in order to take the average (per nic card). Normally production servers have two nic cards. I have tried the following:
>logparser "SELECT AVG(\\SERVERNAME\NETWORK INTERFACE(INTEL ...)) FROM "
I am getting the following error,
Error: Syntax Error: : no matching closing parenthesis
PLEASE HELP!
| Content (c) 2008 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved. |