The Windows NT Performance Monitor

Track system performance and customize the output to meet your needs.

Michael D. Reilly

March 1, 1997

11 Min Read
ITPro Today logo in a gray background | ITPro Today

Taking your system's pulse

Whether you have just installed Windows NT and want to investigateNT further or you want to tune an existing installation, Performance Monitoris a good place to start. This utility lets you track variations in the useof system resources over time and set alerts on the use of specific resources. Youcan even monitor systems remotely, which is a great help in tracking downproblems in your network. And Performance Monitor can measure applicationperformance, not just operating system performance.

You will find Performance Monitor in NT 4.0's Administrative Tools folder.In NT 3.51 and earlier, look in the Administrative Tools program group. No majordifferences in Performance Monitor's functionality exist between the versions ofNT.

Selecting Parameters to Monitor
When you first open Performance Monitor, you see the blank Chart screen. Youmust select which objects, instances, and counters to monitor.To begin, click the + icon on the toolbar, or use the Edit, Add To Chart menuoption. Screen 1 shows the result.

An object is any system component that has a set of measurable properties.An object can be a physical component (such as a hard disk, memory, or a CPU), alogical component (such as a disk volume), or a software component (such as aprocess, a thread, or a redirector).

An instance shows how many occurrences of a particular object are in thesystem. For example, Screen 1 shows only one Processor instance (in trueprogramming fashion, called instance 0), so you know that this computer has onlyone CPU. However, if you look at the PhysicalDisk object on this computer, yousee instances 0 and 1, because you have two physical hard disks. New in NT 4.0is Total instance, which gives you the combined values for all instances.

Each object has multiple counters, each of which is a measurable attributeof the object. In Screen 1, the Processor object has several counters, includingthe percentage of processor time in use and percentage of time the CPU spends inPrivileged and User modes. By default, Performance Monitor opens this selectionscreen with the Processor object as the focus and the %Processor Time counterhighlighted. This counter is one of the most commonly used counters and,therefore, a good choice for a default. You can monitor many counters, but someare more important than others. Table 1 provides a good starting point forchoosing counters. Select the counters you want to monitor, and click Add toinclude them in the display. For a concise and useful explanation of a counter,click Explain. When you finish adding counters, close this selection window andwatch the graphical display.

Performance Monitor has approximately 350 different counters. Screen 2graphs performance for several counters. The peaks in the CPU usage are fromrunning the Pinball utility (OK, game) in demo mode, which takes all of my486DX4-100. At the same time, I was copying some files across the network, so Iwas also measuring the disk writes and bytes per second on the network. Eachcounter is a different color on the graph, and you can customize the display. Ifyou are showing the graph to a group of people, particularly on a projectionsystem, you can make the lines on the chart thicker. And if necessary, you canvary the scale for each item, although I've found the default values are usuallyclose to what I want.

A legend of the monitored counters appears at the bottom of the screen.Click a counter to have the values appear in the boxes just above the legend.The values listed are the last, average, maximum, and minimum values, and thetimescale in seconds for the chart display.

Hints and Tips
While you're looking at the chart, press Ctrl+H. This command thickens thewhite line for the counter you've selected and makes identifying this countereasier when you have multiple counters displayed on the same screen. PressCtrl+H again to turn off this option.

Oh yes, let me mention a couple of things that everyone, including me,finds confusing. First, if you want to monitor disk parameters, you have to goto a command prompt, type

diskperf -y

and reboot the computer. To turn this option off, you must type

diskperf -n

and again, reboot. Microsoft added this step because monitoring diskperformance imposed a 1 percent to 2 percent performance penalty on a 386-basedsystem. Pentium and 486 systems do not suffer from this performance penalty. Nowthat NT 4.0 runs only on 486 and better CPUs, Microsoft needs to considerturning on disk monitoring as the default.

Be aware that you can easily confuse the Process and the Processorobjects. The Process object represents a running program, in other words, anobject using system resources. Its counters track how much of each systemresource the process is using. The Processor object is the CPU, which is asystem resource. Some counters, such as %Processor Time, appear in both objects,so you have to be careful which object you select when you pick the counters.

Charts, Reports, and Logs
The chart view in Screen 2 is only one way to analyze data with PerformanceMonitor. You also can generate reports and logs. A report is atext-based view of selected counters, as shown in Screen 3, updated atintervals. The default interval is every five seconds.

A log is a file in which you can trap data for analysis in PerformanceMonitor or another utility. You can build log files on a regular schedule to seehow performance trends develop. Keep in mind that Performance Monitor does notallow for long-term trend analysis: The best you can do is take snapshots of thedata at intervals and compare that data using a program such as Microsoft Excel.(Some third-party programs that offer the ability to analyze trends over timewill soon be available.)

To set up the log, select the objects you want to track, as shown in Screen4. At this point, you select objects only, not counters. Performance Monitorwill track all the counters for each object and store them in a log file.

Next, set the Log Options. Click the Options button on the toolbar, orselect Options, Log from the menu. As Screen 5 shows, you must specify a logfilename and an update interval. You also start and stop collecting data fromthis dialog box.

Once you've started data collection, the Status box you see on the upperright side of Screen 4 changes from "Closed" to "Collecting."After you collect the data, you can export it or look at it with PerformanceMonitor. Reading the data from Performance Monitor can be confusing at first:Use the Options, Data From menu option, and instead of measuring currentactivity, read in the log file. Now if you change to the chart, alert, or reportview, you can select which counters to display (Performance Monitor limits yourchoices to only those objects you monitored for the log file).

You might be wondering, "What's the point of setting an alert on thehistorical data contained in the log file?" You can set an alert and seewhether the counter reached some upper or lower acceptable limit during the timePerformance Monitor was collecting the log. The alert works similarly to asimple search function.

Setting Alerts
For a system administrator, the ability to set alerts is one of the mostcompelling reasons to use Performance Monitor. You can set Performance Monitorto send an alert for any counter when the value goes above or below some setvalue. You can also run a program. For example, when the SQL Server transactionlog reaches 90 percent of capacity, you can dump the transaction log (that is,back it up to tape and reclaim the space). Screen 6 shows the dialog box forsetting alerts. Notice the multiple instances for the LogicalDisk object.Physical disk 0 has three logical drives--C:, D:, and E:--and physical disk 1has one logical drive--F:. The alert is set to trigger if the total freemegabytes on all the drives drops below 100.

Obviously, for this alert to happen, Performance Monitor must be running.You need to configure the Messenger and Alert services to start automatically.

Saving Your Workspace
Now that you've configured your charts, logs, reports, and alerts, savethese configurations so you don't have to re-create them next time you usePerformance Monitor. On the File menu, you have the option to save the settings.This option changes depending on whether you are looking at the chart, log,alert, or report. In addition to saving each view, you can save the workspace,which is the combination of the various views. The File, Save Workspace menuoption will save all the settings in a file, which by default ends in a .pmwextension. Then you can restore the workspace exactly as it was the next timeyou use Performance Monitor, using the File, Open option to read in your storedsettings file. You can store different combinations of counters in separate .pmwfiles and recall them as needed. You might have one set of Performance Monitorparameters for measuring database applications, another for watching networktraffic when backups are taking place across the network, and so on.

Monitoring Remote Computers
You can monitor another system as easily as your own, if you have thenecessary access rights. At the top of the Add To Chart screen you see in Screen1, find the computer name. Click the ellipsis to the right of the computer nameto bring up a selection dialog box that shows the domains, workgroups, andcomputers in your network. Select the computer you want to monitor, select thecounters for that computer, and close the selection window. At the bottom of thechart screen in Screen 7, the computer name appears with the parameter you'remonitoring. The peaks on the graph occur when the screen saver is activated onthe remote computer. The drain on CPU resources is the reason screen savers arenot recommended on servers!

Is Overhead a Problem?
Performance Monitor is a process running on your computer, so it will takeup some resources. You can track how Performance Monitor affects your system bylooking at perfmon, one of the instances in the Process object. Most of theimpact is in the CPU resources needed to run the Performance Monitor display,not to track the counters. This effect is one reason some system administratorsand database administrators prefer to run Performance Monitor on anothercomputer and monitor the database server remotely. Then the only effect on theserver is in passing the counters back to the monitoring system, which does nottake up much CPU time.

When you select an object in any view, Performance Monitor collects data onall the counters for that object but displays only those you specify. Again, theoverhead is not significant compared with the demands of the on-screen display,which is updated continuously. The Performance Monitor process runs at apriority 12 (normal priority is 8, or 7 for NT 3.51 and earlier), so PerformanceMonitor gets the CPU cycles it needs to update the screen.

Adding Counters
Applications can add their own counters to NT's Performance Monitor. Forexample, SQL Server adds more than 35 new counters. Screen 8 shows some SQLServer objects. (The objects will appear in the Performance Monitor selectionscreen only if SQL Server is running, so don't worry if you don't see them onyour system.) IBM's DB-2 for NT adds approximately 140 counters. This feature isneat because you can monitor both the application counters and the systemcounters at the same time on the same screen. For example, you can monitor thenumber of transactions per second in a database, against the network traffic.Does the network traffic increase dramatically when one group of users runsqueries? If so, perhaps they are moving too much data across the network ratherthan using client/server methods to reduce the traffic.

If you are building applications to run on NT, you can add counters toPerformance Monitor and make them available to your users. This approach savesyou the trouble of writing all the code needed to monitor performance in yourapplication and provides a high level of integration with the operating system.

Summary
Performance Monitor offers many more options than I've covered in thisarticle, and all are relatively easy to use. You can customize the appearance ofyour charts, add vertical and horizontal grids, vary the update interval, anddisplay data as histograms instead of lines on the chart. The real challenge isto become familiar with the various counters and know what to monitor in yournetwork. (For further information on Performance Monitor's capabilities, see "RelatedArticles in Windows NT Magazine," and "References.")

REFERENCES

For more information on Performance Monitor, see Microsoft'sResource Kits for Windows NT:

Microsoft Windows NT 4.0 Workstation Resource Kit

Chapters 9 through 16 cover perfor-mance measurement, tuning, andoptimization with Performance Monitor, Task Manager, and other tools, some ofwhich are in the Resource Kit.

Windows NT 3.5/3.51 Resource Kit

This Resource Kit contains an entire volume on Performance Monitor, "OptimizingWindows NT." The first part is an introduction to Performance Monitor,followed by a section on bottleneck detection. The second part of the book isfor programmers and shows how you can add your counters to Performance Monitor.This programming information did not make it into the NT 4.0 Resource Kit, so ifyou have a copy of the NT 3.5 Resource Kit, hang on to Volume 4.

You can find Performance Monitor Counter Definitions in a help file,commonperf toolcntrtoolcounters.
hlp, on the CD-ROM that comes with theWindows NT 4.0 Workstation and Server resource kits.

RELATED ARTICLES IN WINDOWS NT MAGAZINE

Mark J. Keller and David P. Stevens

"Tuning SQL Server," January 1996

Robert D. Schneider

"10 Easy Tips for Better SQL Server Performance," October 1996

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like