Setting Alerts
For a system administrator, the ability to set alerts is one of the most
compelling reasons to use Performance Monitor. You can set Performance Monitor
to send an alert for any counter when the value goes above or below some set
value. You can also run a program. For example, when the SQL Server transaction
log 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 for
setting alerts. Notice the multiple instances for the LogicalDisk object.
Physical disk 0 has three logical drives--C:, D:, and E:--and physical disk 1
has one logical drive--F:. The alert is set to trigger if the total free
megabytes 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, save
these configurations so you don't have to re-create them next time you use
Performance 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 menu
option will save all the settings in a file, which by default ends in a .pmw
extension. Then you can restore the workspace exactly as it was the next time
you use Performance Monitor, using the File, Open option to read in your stored
settings file. You can store different combinations of counters in separate .pmw
files and recall them as needed. You might have one set of Performance Monitor
parameters for measuring database applications, another for watching network
traffic 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 the
necessary access rights. At the top of the Add To Chart screen you see in Screen
1, find the computer name. Click the ellipsis to the right of the computer name
to bring up a selection dialog box that shows the domains, workgroups, and
computers in your network. Select the computer you want to monitor, select the
counters for that computer, and close the selection window. At the bottom of the
chart screen in Screen 7, the computer name appears with the parameter you're
monitoring. The peaks on the graph occur when the screen saver is activated on
the remote computer. The drain on CPU resources is the reason screen savers are
not recommended on servers!
Is Overhead a Problem?
Performance Monitor is a process running on your computer, so it will take
up some resources. You can track how Performance Monitor affects your system by
looking at perfmon, one of the instances in the Process object. Most of the
impact is in the CPU resources needed to run the Performance Monitor display,
not to track the counters. This effect is one reason some system administrators
and database administrators prefer to run Performance Monitor on another
computer and monitor the database server remotely. Then the only effect on the
server is in passing the counters back to the monitoring system, which does not
take up much CPU time.
When you select an object in any view, Performance Monitor collects data on
all the counters for that object but displays only those you specify. Again, the
overhead is not significant compared with the demands of the on-screen display,
which is updated continuously. The Performance Monitor process runs at a
priority 12 (normal priority is 8, or 7 for NT 3.51 and earlier), so Performance
Monitor gets the CPU cycles it needs to update the screen.
Adding Counters
Applications can add their own counters to NT's Performance Monitor. For
example, SQL Server adds more than 35 new counters. Screen 8 shows some SQL
Server objects. (The objects will appear in the Performance Monitor selection
screen only if SQL Server is running, so don't worry if you don't see them on
your system.) IBM's DB-2 for NT adds approximately 140 counters. This feature is
neat because you can monitor both the application counters and the system
counters at the same time on the same screen. For example, you can monitor the
number of transactions per second in a database, against the network traffic.
Does the network traffic increase dramatically when one group of users runs
queries? If so, perhaps they are moving too much data across the network rather
than using client/server methods to reduce the traffic.
If you are building applications to run on NT, you can add counters to
Performance Monitor and make them available to your users. This approach saves
you the trouble of writing all the code needed to monitor performance in your
application and provides a high level of integration with the operating system.
Summary
Performance Monitor offers many more options than I've covered in this
article, and all are relatively easy to use. You can customize the appearance of
your charts, add vertical and horizontal grids, vary the update interval, and
display data as histograms instead of lines on the chart. The real challenge is
to become familiar with the various counters and know what to monitor in your
network. (For further information on Performance Monitor's capabilities, see "Related
Articles in Windows NT Magazine," and "References.")
REFERENCES
For more information on Performance Monitor, see Microsoft's
Resource Kits for Windows NT:
Microsoft Windows NT 4.0 Workstation Resource Kit
Chapters 9 through 16 cover perfor-mance measurement, tuning, and
optimization with Performance Monitor, Task Manager, and other tools, some of
which are in the Resource Kit.
Windows NT 3.5/3.51 Resource Kit
This Resource Kit contains an entire volume on Performance Monitor, "Optimizing
Windows NT." The first part is an introduction to Performance Monitor,
followed by a section on bottleneck detection. The second part of the book is
for 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 if
you 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,
\common\perf tool\cntrtool\counters.
hlp, on the CD-ROM that comes with the
Windows 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