Microsoft Windows 2000 Server Administrators Companion (IT-Administrators Companion)

[Previous] [Next]

Performance Logs and Alerts expands the monitoring capabilities of System Monitor to include features for logging counter and trace data and for generating performance alerts. Using the capabilities of Performance Logs and Alerts has a number of advantages. Logged counter data information can be exported to spreadsheets or databases for analysis and report generation. The data can be stored in three formats: comma-separated format, tab-separated format, or in a binary log-file format that can be used for logging instances that may have started after the log had already begun collecting data or for circular logging. In circular logging, new data is continuously logged into a single file, with the new data overwriting the old data.

Performance logging runs as a service. As a result, a user doesn't have to be logged on to the monitored computer for data collection to occur. You can manage multiple logging sessions from a single console window and view data as it is collected as well as after collection has stopped. Automatic log generation enables you to define parameters such as filename, file size, and start and stop time. An alert can be set on a counter to cause a specific action to occur, such as starting a specified program, sending a notification message, or starting a log when the value of a selected counter falls below or exceeds a specified setting.

Counter Logs

A counter log collects data at a predefined interval. Counter logs are helpful for recording data about system services activities and hardware usage from the local machine or a remote machine. You can log data manually on demand or schedule logging to start and stop automatically. The system can also perform continuous logging, depending on the file size and duration limits you set. The logged data can be viewed through the System Monitor display or exported to spreadsheets or databases.

You can view the counters configured in the counter log dynamically through System Monitor by saving log settings such as counters as an HTML page. The resulting page hosts the System Monitor control through an ActiveX control that provides the interface for the monitoring user.

Trace Logs

Rather than measure samples at a predefined interval, as counter logs do, a trace log monitors data continuously and waits for specific events, such as page faults, to occur. That data is then recorded into a trace log file. To interpret the trace log output, you need a parsing tool.

NOTE


A parsing tool is software that reads the raw data and puts it into a form you can understand. Developers can create parsing tools by using the APIs provided at Microsoft's MSDN Online Library site at http://msdn.microsoft.com/library/default.htm.

Creating Counter and Trace Logs

To create a counter log or a trace log, perform the following steps:

  1. Open System Monitor, and double-click Performance Logs And Alerts.
  2. Choose Counter Logs to create a counter log, or choose Trace Logs to create a trace log.
  3. Right-click in a blank area of the details pane and choose New Log Settings. In the Name text box, enter the name of the counter or trace log you are creating and click OK. A Properties window for configuring the counter or trace log you are creating is displayed.
  4. Configure the counter or trace log to monitor your local or remote machine by choosing the proper counters for the resources to be monitored, selecting log file properties, and choosing the desired scheduling options. Any logs that already exist will be listed in the details pane. A red icon indicates a log that is not running or that has been stopped; a green icon indicates a log that is running.

The sample data interval for counter logs is set on the General tab of the Properties window for the log. For guidelines on setting time intervals, see "Determining How Often to Monitor" later in this chapter.

Adding Counters to Counter Logs

Counters are added on the General tab of a log's Properties window (Figure 32-11). When you create a counter log file, the Properties window is displayed automatically. If you need to add counters later, you can display the Properties window by right-clicking the name of the log file, choosing Properties from the shortcut menu, clicking the Add button on the General tab, and then choosing the desired counters. The procedure for selecting counters is identical to that described earlier in the section "Selecting Counters."

Figure 32-11. The General tab of a log's Properties window.

Saving Log and Alert File Settings

To save the settings for a log or alert file, right-click the name of the log or alert file in the details pane, and then choose Save Settings As from the shortcut menu. Enter the name you want to give to the log or alert file, and save it as an .HTM file. You can use the saved settings for a new log or alert by right-clicking in the details pane, choosing New Log Settings From, and then selecting the .HTM file containing the settings you want to reuse.

Selecting System and Nonsystem Providers for Trace Logs

Events in trace logs are monitored not by counters but by providers. You can choose to log events by system or nonsystem providers. The default system provider, the Windows Kernel Trace Provider, monitors threads, processes, disk input/output, network TCP/IP, page faults, and file details. The system provider uses the most overhead to monitor events. Only one trace log at a time can be run using the system provider. If you attempt to run more than one, you will receive an error message.

System and nonsystem providers are chosen on the General tab of the log's Properties window (Figure 32-12). To see this window, right-click the name of the trace log file and choose Properties from the shortcut menu. On the General tab, either select the Events Logged By System Provider option and then choose the events you want to monitor, or select the Nonsystem Providers option and then add the nonsystem providers of your choice by clicking the Add button.

Figure 32-12. Specifying events logged by the system provider.

It is important to remember that trace logging of page fault and file details generates a huge amount of data. Microsoft recommends that you limit trace logging using these fault options to a maximum of two hours; otherwise you may run out of disk space on your machine.

Choosing nonsystem providers to monitor the system incurs less overhead. With nonsystem providers, you can select the data providers of your choice. You cannot run concurrent multiple trace logs using the same nonsystem provider, but you can do so using different nonsystem providers. The nonsystem providers available in Windows 2000 are Active Directory: Kerberos, Active Directory: Net Logon, Active Directory: SAM, Local System Authority (LSA), and Windows NT Active Directory Service.

Setting File Parameters for Counter and Trace Logs

To set file parameters for counter and trace logs, follow these steps:

  1. Double-click Performance Logs And Alerts in System Monitor.
  2. Click Counter Logs to set file parameters for counter logs, or click Trace Logs to set file parameters for trace logs.
  3. Double-click the name of the log for which you want to set the file parameters. A window displaying the properties of the log appears.
  4. Click the Log Files tab, and set the desired parameters for the log file. (The available parameters are described in the next section.)

Understanding the Log File Parameters

The Log Files tab of the Properties window for a counter or trace log (Figures 3213 and 32-14) allows you to set a number of file parameters. You can specify a folder other than the default chosen by Windows 2000 in the Location box. The default location is the PerfLogs folder at the root directory. You are also given the option of ending the filename with a set of sequential numbers or a date to keep track of multiple log files. This is helpful for log files that are automatically generated with the same filename.

Figure 32-13. The Log Files tab of a counter log's Properties window.

Figure 32-14. The Log Files tab of a trace log's Properties window.

A file size option is available with which you can either allow the log file to become as large as disk quotas or the operating system will permit or limit the size to a specific number of kilobytes. Limit the size of a log file if you want to use one of the circular logging options. In conjunction with limiting the size of a log file, you can use the When The Log File Is Full option on the Schedule tab to run a command if you want a particular action to occur when the log file reaches its limit. You can choose from among four file types for a counter log:

Trace logs can be either of two file types:

The default file type for counter logs is Binary File (with the extension .BLG), and the default file type for trace logs is Sequential Trace File (with the extension .ETL).

Using Alerts

An alert notification is sent to the user by means of the Messenger service when a predefined counter value reaches, falls below, or rises above a defined threshold. The Messenger service must be running for alert notifications to be sent to the user.

Creating an Alert

To create an alert, follow these steps:

  1. Open System Monitor, and double-click Performance Logs And Alerts.
  2. Click Alerts.
  3. Right-click in a blank area of the details pane, and choose New Alert Settings. In the Name text box, enter the name of the alert you are creating, and click the OK button. A Properties window for configuring the alert you are creating appears (Figure 32-15).
  4. Figure 32-15. The Properties window for an alert.

  5. Configure the alert by specifying whether to monitor the local machine or a remote machine, choosing one or more counters, setting threshold values for the counters, selecting an action to perform when an alert is triggered, and choosing the desired scheduling options. These settings are described in the next section. Any alerts that already exist will be listed in the details pane. A red icon indicates an alert that is not running or has been stopped; a green icon indicates an alert that is running.

Configuring an Alert

For information on specifying a computer to monitor and on selecting counters for the alert, see the section "Selecting Counters" earlier in this chapter.

You must choose threshold values for each counter on which you set an alert. This is done on the General tab of the Properties window for the alert. When you create an alert, the Properties window is displayed automatically. If you need to add counters at a later date, you can access the Properties window by right-clicking the name of the alert file, choosing Properties from the shortcut menu, and clicking the Add button on the General tab.

You set thresholds to trigger an alert when the value of the counter falls either above or below a certain baseline for your organization. To establish a baseline, you must determine the level of system performance that is acceptable when your system is experiencing a typical workload and running all required services. You do this by reviewing logged data graphed by System Monitor or by exporting the data and generating reports for analysis.

On the Action tab of the Properties window, you can specify actions that should occur when a threshold is exceeded. You have four options available:

Permissions for Counter Logs, Trace Logs, and Alerts

To create or modify a log or alert, you must have Full Control permission for the registry entry KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysmonLog\LogQueries. Administrators are usually assigned this permission by default, and they can grant this permission to users in Regedt32.exe through the Security menu.

To run the Performance Logs and Alerts service, you must have permissions to configure or start services on the system. Administrators are usually assigned this permission by default, and they can grant this permission to users in the Group Policy snap-in. Furthermore, to log data for a remote computer, the Performance Logs and Alerts service is required to run under an account that has access to that remote system. The service runs in the background once a log or alert is configured and running.

REAL WORLD  Tuning and Testing Strategies


Before starting System Monitor or Performance Logs and Alerts on the computer you are monitoring, do the following:

Keep the following best practices in mind when preparing to tune your system:

Selecting a Monitoring Method

If you need to observe a system event as it's happening, use a graph in System Monitor. Graphs are helpful for real-time short-term monitoring of a remote or local computer. Choose an update interval that best captures the data for the type of activity you are observing. Performance logs are better suited for long-term monitoring and record keeping. You can export logged data and use it to generate reports, and you can also view the information as graphs or histograms using System Monitor. Logging in this manner is also more practical when you need to monitor several computers at once.

Determining How Often to Monitor

For routine logging of data logs, start out by setting the value in the Sample Data Every box to every 15 minutes. To find this option, display the Properties window of the specific counter log. You can adjust this interval to fit the type of data you are monitoring. If you have a slow memory leak, for example, you will want to use a longer time interval. Another consideration is the overall length of time that you monitor a system. If you are monitoring for less than 4 hours, a 15-minute interval is acceptable. If you are monitoring a system for 8 hours or more, don't set a time interval that is shorter than 5 minutes (300 seconds). Monitoring at a frequent rate will cause the system to generate a lot of data, producing large log files. It will also increase the overhead tremendously.

Monitoring Memory Usage

If you are experiencing performance problems, the first step in examining the problem is usually to monitor memory usage because memory usage is the most important factor in system performance. If you find that your system is paging frequently, you may have a memory shortage on your machine. Some paging is good because it helps to expand memory somewhat, but too much paging is a drain on system performance.

NOTE


Paging is used to free memory for other uses by moving fixed-size blocks of data and code from RAM to your disk in units called pages.

Before you start to monitor memory usage, you should perform a few checks. For example, verify that your system has the recommended amount of memory for running the operating system as well as other applications and services. If you don't know what the memory requirements are for a process, you can discover its working set within System Monitor, shut the process down, and observe the effect on paging activity. The amount of memory that is freed when you terminate a process is the amount of memory the process was using.

NOTE


A working set is the portion of physical memory allocated to each program running on the computer.

Excessive paging can result when Windows 2000 Setup configures your system with settings that optimize file sharing. In some cases, this can increase paging significantly because it causes the system to maintain a large system-cache working set. If you are not using the server for file sharing, you can reduce the amount of paging on your server by turning off the file-sharing settings. To do so, follow these steps:

  1. On the Start menu, point to Settings and then choose Network And Dial-Up Connections.
  2. Right-click Local Area Connection and choose Properties from the shortcut menu.
  3. In the Components Checked Are Used By This Connection box, highlight File And Printer Sharing For Microsoft Networks and click the Properties button.
  4. In the Server Optimization area, the Maximize Data Throughput For File Sharing option is selected by default. Select Maximize Data Throughput For Network Applications instead (Figure 32-16). This action will reduce paging activity on your system.
  5. Figure 32-16. The File And Printer Sharing For Microsoft Networks Properties window.

Recommended Counters

Monitor memory counters for a low-memory condition. This section lists the minimum recommended counters for monitoring the server's memory component. To check for possible memory leaks or bottlenecks, monitor these counters:

To monitor for a low memory condition, use these counters:

To check for excessive paging, monitor these counters:

Tuning and Upgrading Tips for the Memory Component

If you are experiencing problems with memory, check the following possibilities:

CAUTION


When the paging file reaches the maximum limit assigned to it, a warning is displayed and your system may halt.

Monitoring Processor Activity

When monitoring processor usage, you need to consider the role of the computer and the work being done on it. High processor values could mean either that your machine is handling the workload in a very efficient manner or that it is struggling to keep up.

When a bottleneck occurs because a process's threads need more processor cycles than are available, long processor queues build up, causing the system response to suffer. The two common causes of processor bottleneck are an excess demand placed on the processor by CPU-bound programs and excess interrupts generated by drivers or subsystem components, such as disk or network components.

Minimum Recommended Counters

The following list shows the minimum recommended counters you should use to monitor the server's processor component for possible bottlenecks:

To monitor possible usage problems, use these counters:

Tuning and Upgrading Tips for the Processor Component

You can try the following solutions to resolve problems you are experiencing with the processor:

NOTE


You set affinity for a particular process or program when you assign it to a single processor in order to improve its performance, at the expense of the other processors. Be forewarned that when you dedicate a process or program to a processor, your other program threads may not be permitted to migrate to the least-busy processor. You can set affinity in Task Manager, and it is available only on multiprocessor systems.

Monitoring Disk Activity

Monitoring disk usage helps you to balance the load of your network servers. When you are monitoring disk performance, log the performance data to another disk or computer to prevent it from skewing the data for the disk you are testing.

NOTE


The operating system collects the Physical Disk counter data by using the Diskperf -yd command by default. This is not true of the Logical Disk counter data, however. In order to obtain performance counter data for logical drives, you must type Diskperf -yv at the command prompt. This command causes the driver used for collecting disk performance data to report data for logical drives. To obtain further information about the Diskperf command, type diskperf -? at a command prompt.

Minimum Recommended Counters

The following list shows the minimum recommended counters you should use to monitor the server's disk performance for possible bottlenecks:

To monitor possible usage problems, use these counters:

Tuning and Upgrading Tips for Disk Activity

If you are experiencing problems with disk performance, try the following solutions:

Monitoring Network Activity

Monitoring the network consists of observing the use of server resources and measuring overall network traffic. Although you can do both with Performance Monitor, Network Monitor, discussed later in this chapter, gives you a more in-depth analysis of traffic.

Start monitoring your system by tracking the minimum recommended counters. Observe the resource usage on your system. Use the counters that correspond to the various layers of your network's configuration in order to concentrate on network-related resource usage. Abnormal network counter values are usually an indication of problems with a server's processor, memory, or hard disks. We recommend that you monitor network counters in conjunction with Memory\ Pages/Sec, Processor\ % Processor Time, and Physical Disk\ % Disk Time. For example, if Memory\ Pages/Sec increases dramatically, accompanied by a decrease in Memory\ Bytes Total/Sec handled by the server, the system is most likely running short of physical memory for network operations.

Minimum Recommended Counters

The following list shows the minimum recommended counters you should use to monitor the network's performance for possible bottlenecks:

To monitor possible usage problems, use these counters:

Tuning and Upgrading Tips for Network Activity

Try the following solutions if you are experiencing problems with network performance:

Категории