Using System Monitor

Using System Monitor

The units of measurement used to monitor hardware and software resources through System Monitor are called counters, which are then further grouped into categories called objects. In some cases, counters also have instances. For example, when monitoring the processor activity of a Web server, you monitor the % Processor Time counter, which is found under the Processor object. If there is more than one processor in the server, you can choose to monitor the total activity of all of the processors or instances for each individual processor.

A default set of System Monitor objects and counters are made available when you install Windows 2000 Server. If a specific application, such as SQL Server, is installed on the server, SQL Server specific objects and counters are also made available. In this case System Monitor will use remote procedure calls to collect information from SQL Server.

System Monitor consumes a small amount of CPU and disk resources on the system it is monitoring, which you should keep in mind when measuring and determining the performance of systems and applications. If you are monitoring the machine remotely, System Monitor will also consume bandwidth from the network card. On highly utilized systems and applications hosted on the Windows 2000 platform, this overhead could be cause for concern, especially if you re monitoring production systems, but in most dedicated test environments it should not be a concern.

In addition to monitoring performance counters, System Monitor allows you to

  • view selected system performance objects and counters in real time.

  • log performance counter information for later analysis.

  • monitor multiple Windows 2000 servers from one instance of System Monitor.

  • create alerts to notify you when certain performance thresholds or conditions occur. For example, when the processor time goes above 90 percent, you can configure the alert to log an entry in the Event Viewer, send a network message, start a performance data log file, run a program when the condition occurs, or all of the above.

  • trace events to record data when certain activities occur for processes, threads, disk I/O, network I/O, file details and page faults. Trace logs require a parsing tool to interpret the output. You can create such a tool using APIs provided at the following location: http://msdn.microsoft.com/msdn-files. Tracing is rarely used, except by Microsoft support providers.

This chapter looks at the first two methods in detail and also provides an overview of the fourth (creating notification alerts).

Viewing Real-Time Performance Data

In real-time mode you can view performance data in three different categories: chart, histogram, or report. Viewing data in real time is useful if you know what you are looking for or if you want to verify the existence of a particular bottleneck. When you have to run a stress test overnight for a bottleneck to appear, the best approach is to log the performance data. See the section Logging and Viewing Logged Data later in this chapter for more information on this topic.

Chart View

The real-time chart view is an excellent method for identifying trends in the data over time and comparing multiple instances of a counter such as % Processor Time. For the most part you will find yourself using chart view for your performance tests, so it s important to become familiar with this particular view to take full advantage of its rich feature set. There are two views available under chart view, graph view and histogram view. An example of the graph view is shown in Figure 4-1.

figure 6-1 system monitor graph view

Figure 4-1. System Monitor graph view

Graph View

  1. Click Start, point to Programs, then Administrative Tools, and then click Performance.

  2. Click System Monitor in the console tree on the left to view System Monitor in the right pane.

    To explain the power of chart view for monitoring performance, we ll walk you through an example of using the graph and histogram views. So, let s say you want to monitor processor utilization of a multiprocessor system. First, launch System Monitor. The performance console that contains System Monitor opens as shown in Figure 4-2.

    TIP
    You can also launch System Monitor by typing perfmon in the Run command.

    figure 6-2 system monitor console tree

    Figure 4-2. System Monitor console tree

  3. If the monitor is not in chart view, click the View Chart button at the top of the right pane to switch to chart view.

Counter Color

Now that you have a graph view containing processor utilization information, let s explore some of the features of System Monitor you can use to work with the performance data you are collecting. Some of the features are specific to chart view, while others can be used under the report and histogram views as well.

It is important to use the colors to distinguish the data you are monitoring. You can choose each color from a palette (in the Property Name list box of the System Monitor Properties dialog box) or you can base the colors on system colors defined using the Display icon in Control Panel. When using the palette, note the following:

  • BackColorCtl refers to the area surrounding the chart.

  • BackColor refers to the chart data-display area.

  • ForeColor refers to the color of the text in the display and legend.

Counter Scale

Depending on the counter you are monitoring, there will be times when you ll need to adjust the counter s scale so the counter information displayed makes more sense. For instance, when monitoring memory-related counters, you will need to increase the scale of the counters that deal with bytes of information. The value of a counter scale can be changed exponentially from .0000001 to 1000000.

Counter Characteristics

When you re selecting counters for data collection, note the counter characteristics. Some counters are formulated as instantaneous and others are averages. Instantaneous counters display the most recent measurements, while averaging counters display the average of the last two measurements over the period between two samples. For the processor object counters on a multiprocessor server, each processor will be listed in the Instances selection box. System Monitor will list the instances from zero. For example, a four-processor server will be listed from instance 0 to 3, where the third instance represents the fourth processor.

It is important that you understand the implications of the counter on the data. For example, if transaction/sec is being monitored, be aware that the data is calculated as the number of transactions counted for the sample time selected. The number of transactions is divided by the number of seconds in the interval selected. Additionally, note how to interpret a spike when working with averaging counters. For example, when you first begin to monitor the % Processor Time counter you may see an initial spike in processor usage. For an accurate view of processor utilization, wait until the second or third reading for the average value for the counter.

Parent Instance Name

If you are monitoring threads of the Microsoft Windows Explorer process, track the Windows Explorer instance of the Thread object (Windows Explorer would be the parent instance), and then each thread running Windows Explorer (these threads are child instances). The instance index allows you to track these child instances. The instance index for the thread you want might be 0, 1, and so on, for each thread, preceded by the number sign (#). The operating system configures System Monitor properties to display duplicate instances by default. Instance index 0 is hidden; numbering of additional instances starts with 1. You cannot monitor multiple instances of the same process unless you display instance indexes.

Computer Name

Each object has counters that are used to measure various aspects of performance, such as transfer rates for disks or the amount of processor time consumed for processors.

Computer Name is the name of the computer that will be displayed at the bottom of the chart view. Be careful when collecting the same objects and counters from different servers; use the colors and different fonts to distinguish between instances on different servers.

Value Bar

The value bar under the chart contains statistical information for the currently selected counters. The value bar can be turned on or off by right-clicking anywhere in the chart and selecting Properties, selecting the General tab in the System Monitor Properties dialog box and deselecting Value Bar under Display Elements.

The values displayed in the value bar are as follows:

  • Last

    The last value displayed for the currently selected counter.

  • Average

    The average value of the currently selected counter.

  • Minimum

    The minimum value of the currently selected counter.

  • Maximum

    The maximum value of the currently selected counter.

  • Duration

    The total elapsed time displayed in the graph, this value is based on the interval value. The interval value you set determines how often counter data should be collected. For more information on the interval setting see the section How Often Should You Collect Data? later in this chapter

Histogram View

The histogram view is the preferred method of viewing data when monitoring multiple instances of the same counter. For example, you can compare the % Disk Read Time for all of the drives in your server to understand which drive is being taxed with read requests. You can switch to histogram view by clicking the Histogram button on the toolbar or typing Ctrl+B. Additionally, you can select Histogram on the General tab of the System Monitor Properties dialog box.

figure 6-3 histogram view

Figure 4-3. Histogram view

Report View

Report view is extremely useful when monitoring counters dealing with logical and physical I/O, such as disk or network I/O. For example, if you have to monitor all the processes running on your Web server concurrently, doing so under chart view would create an extremely hard-to-read graph or histogram. Instead, you can switch to report view for an easy-to-read view of the data.

To view real-time data as a report, you can click the Report tool on the toolbar or type Ctrl+R. Or, you can select Report on the General tab of the System Monitor Properties dialog box.

How Often Should You Collect Data?

For both real-time performance monitoring and data logging, you can set a specific interval for data collection. The interval you set for data collection will have a significant impact on your ability to capture potential performance bottlenecks. For the most part, the type of bottleneck you are investigating will determine the interval period you set. For instance, if you are monitoring a problem that manifests itself slowly, such as a memory leak, you should set a longer interval period. On the other hand, if the bottleneck tends to occur frequently, set a lower interval period. When you re not sure of the bottleneck or when it s occurring, setting the interval period to 15 minutes should be sufficient to start with.

Also consider the overall length of time you want to monitor when choosing this interval. Updating every 15 seconds is reasonable if you will be monitoring for no more than four hours. If you ll be monitoring a system for eight hours or more, do not set an interval shorter than 300 seconds (five minutes). Setting the update interval to a frequent rate (that is, a low value) can cause the system to generate a large amount of data, which can be difficult to work with especially if you re simultaneously monitoring a large number of counters.

Monitoring many objects and counters can also generate a large amount of data and consume disk space. Try to strike a balance between the number of objects you monitor and the sampling frequency to keep log file size within manageable limits.

If you prefer to maintain a long update interval when logging, you can still view data fluctuations that occur between those intervals. To do so, see the next section, Logging and Viewing Logged Data for information about manipulating time ranges within logs.

Logging and Viewing Logged Data

One of the most valuable features of System Monitor is its logging capability. Regular logging of performance data allows you to compare before and after a change to the system s hardware, software, or application. For example, your company decides to launch a new marketing campaign selling its most popular widgets at 50 percent off. This sale causes a dramatic increase in traffic to the company s Web site. Logging performance data will allow you to compare and contrast the effects of the increased user transaction before, during, and after the sale. This information can then be analyzed to determine whether the Web site is suffering from any bottlenecks or whether you have adequate hardware to support future marketing campaigns.

You can capture System Monitor data for a specific period of time and then analyze and compare the performance log files later on. This will allow you to view the system behavior over time, which can reveal trends in system usage that you might not see when viewing real-time data. For example, in your log files you might find that disk utilization is typically high from 8 P.M to 10 P.M and lower for the remainder of time. You might be able to equate this trend to heavy data entry or a database backup during these times.

NOTE
When you use System Monitor, it is most efficient to start the log locally on the server you want to collect data from. You can access the log file later from a remote system if you need to. If you must log over the network, reduce the number of objects and counters to the most critical ones.

To start logging information on a Windows 2000 server using System Monitor, follow these steps:

  1. Click Start, Programs, then point to Administrative Tools, and click Performance.

  2. Expand Performance Logs And Alerts in the left pane of the performance window.

  3. Select Counter Logs in the console tree.

  4. In the right pane, right-click and choose New Log Settings from the shortcut menu as shown in Figure 4-4.

    figure 6-4 create log

    Figure 4-4. Create log

  5. Enter a name to identify the log settings in the New Log Settings dialog box as shown in Figure 4-5, and then click OK. We chose IBuyspy for the name of this log setting.

    figure 6-5 new log settings

    Figure 4-5. New Log Settings

  6. The name you choose for the log setting will appear as the title for the Performance Log dialog box. Click the Add button to open the Select Counters dialog box.

  7. Add the counters that you want saved to the log file by highlighting them and then clicking the Add button. When finished adding counters, click Close in the Select Counters dialog box. On the General tab of the Performance Log dialog box, you can also set the interval for sampling data.

  8. Click the Log Files tab to set log file specific information, such as location, file name, file type, and maximum file size limit. Use CSV files for the default file type, especially if you are collecting data for a long period of time, in order to maintain manageability. As shown in Figure 4-6, in this example we save the file locally.

    NOTE
    It is always a good idea to select a high interval for the sampling data value when collecting performance data over a long period of time. This is most important to note when saving data as a binary file binary files are always larger than CSV files.

    figure 6-6 log file information

    Figure 4-6. Log file information

  9. Click the Schedule tab to set the schedule for logging. If you do not enter a time for the logging to stop, it will continue until you stop it manually.

  10. Click OK. The log file name should appear in the right pane. The green icon next to the log name shows logging has started, as shown in Figure 4-7.

    figure 6-7 log file started

    Figure 4-7. Log file started

    The icon will be red if the logging is stopped. You can start and stop logging manually in this window by right-clicking the name of the log setting and choosing Start or Stop from the shortcut menu.

After you have collected information and stopped the logging process, use the following steps to load logged data into the system and view it.

  1. Click System Monitor in the left pane to view System Monitor in the right pane.

  2. Click the View Log File Data button at the top of the right pane to open the Select Log File dialog box, as shown in Figure 4-8. Navigate to the folder and select the log file you want to view and then click open.

    figure 6-8 log file dialog box

    Figure 4-8. Log File dialog box

  3. Click the Add button to add the counters you want to view from the selected log file. When you close the Add Counters dialog box you will see the selected counters in System Monitor, as shown in Figure 4-9. Only the counters selected for initial logging will be available for viewing.

    figure 6-9 add counters

    Figure 4-9. Add Counters

You can narrow your view of the log file by following these additional steps:

  1. After you have loaded your log file into System Monitor, click the Properties button at the top of the right pane.

  2. In the System Monitor Properties dialog box, click the Source tab.

  3. Near the bottom of the Source tab, slide both ends of the slide window to include the times that you want to see in the View range as shown in Figure 4-10.

    figure 6-10 log file information

    Figure 4-10. Log file information

  4. (Optional) Use the other tabs in System Monitor Properties dialog box to change the different characteristics of the output.

  5. Click OK to return to System Monitor and view the selected range of the data.

Monitoring Remote Computers

With System Monitor you can remotely collect and monitor data from multiple machines. There could be several reasons why you would want to monitor remote machines for example, the server in question could be located in a lab or production environment across the country.

Before you start monitoring remote computer performance you must have Access This Computer from the Network rights. These rights are granted by following these steps:

  1. From the Administrative Tools folder, launch the Local Security Policy program.

  2. Double-click the Local Policies folder to expand it.

  3. Double-click the User Rights Assignment folder. The currently defined list of policy rights will be displayed.

  4. Find the policy Access This Computer from the Network and double-click to open it. A list of users and groups assigned to the policy will be displayed.

  5. To assign additional users or groups to the policy click the Add User or Group button.

To monitor a remote computer follow these steps:

  1. Start System Monitor and then press Ctrl+I to open the Add Counters dialog box.

  2. In the Select Counters From Computer list, select or type the name of computer you want to monitor.

You should keep your connection speed in mind when monitoring computers remotely. If you have a slow connection speed (128 Kbps or slower) you may want to switch from the default chart view to report view. This way you ll be passing far fewer graphics over the wire, and avoiding delays in results being displayed on your screen.



Performance Testing Microsoft  .NET Web Applications
Performance Testing Microsoft .NET Web Applications
ISBN: 596157134
EAN: N/A
Year: 2002
Pages: 67

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net