Use Command Line To Monitor Server Performance

Posted on December 22, 2011 by Jeff Hicks in Networking with 0 Comments

Overview

For IT Pros, knowing how a server is behaving or performing is critical. Ideally, you want your servers to be performing optimally to keep your boss and end users happy. Or you may need to peek at what is going on to solve a problem. There are a number of 3rd party performance monitoring tools, not to mention the Performance Monitor management console that comes with every version of Windows, but sometimes you only need a “quick and dirty” solution. For those situations, you can turn to your command prompt and TYPEPERF.EXE.

TYPEPERF.EXE

As with most performance monitoring, the best approach is to remotely monitor the system in question. So we’ll use typeperf from a Windows 7 desktop. Open a command prompt. If you don’t have a shortcut handy to CMD.EXE click on the Start orb and type cmd.exe in the Search box. Click on the link. To see how to use this tool at the prompt type: typeperf /?.


Figure 1 TypePerf help

Sponsored

There are two types of performance counters: those with instances and those without. The former are counters that apply for each instance of an object, such as a logical disk or processor. For example there is a counter with no instances that will return the % processor time. Or you can get a counter that is instance specific, say for the first processor. To get the list of counters I would suggest these commands:

These commands will run against your Windows 7 box. If you are interested in application counters that might exist on a remote server, then incluse the –s parameter.

Once you’ve identified the counter or counters, at the prompt run a command like this:


Figure 2 TypePerf with a remote computer

 

This will create CSV ouput every second until you press Ctrl+C. This is very handy when you want to watch in real time. But if you only want to capture data for later analysis you most likely will run a command like this:

Now we’ll get a CSV file with 60 samples taken every 2 seconds. But more than likely you will want to capture several counters. This is where the text files we created earlier come in handy.

Sponsored

Copy and paste the counters you want to watch in a new text file. You can include counters from multiple remote computers. Make sure the computer name is part of the counter name. Once you have the list, run a command like this:

To use this config file run a command like this:

Conclusion

It really is that simple. Personally, I find I can run typed commands faster than I can navigate through a GUI and if this is something you find yourself needing on a regular basis, I think you’ll find this much easier, once you compete your initial setup.

Sponsored