13 lesson 2: using the performance consoleit344.groups.et.byu.net/08wi/labs/lab6/performance... ·...

15
19-13 Lesson 2: Using the Performance Console Windows XP Professional provides two tools for monitoring resource usage: the Sys- tem Monitor snap-in and the Performance Logs And Alerts snap-in. Both of these snap-ins are contained in the Performance console. You use the System Monitor snap- in to track resource use and network throughput. You use the Performance Logs And Alerts snap-in to collect performance data over time from the local or a remote com- puter or to have Windows XP alert you when a particular performance threshold is crossed. After this lesson, you will be able to Use System Monitor to monitor resource usage Add counters to System Monitor Use Performance Logs And Alerts to track a computer’s performance Establish a baseline for performance data Identify and resolve bottlenecks Estimated lesson time: 30 minutes How to Use System Monitor To access the Performance console, click Start, click Control Panel, click Performance And Maintenance, click Administrative Tools, and then double-click the Performance shortcut. The Performance console contains the System Monitor snap-in and the Per- formance Logs And Alerts snap-in (see Figure 19-5). F19us05 Figure 19-5 The System Monitor snap-in displays counter values in a graph by default. Lesson 2 Using the Performance Console

Upload: dangthuan

Post on 29-Apr-2018

215 views

Category:

Documents


2 download

TRANSCRIPT

19-13

Lesson 2: Using the Performance ConsoleWindows XP Professional provides two tools for monitoring resource usage: the Sys-tem Monitor snap-in and the Performance Logs And Alerts snap-in. Both of thesesnap-ins are contained in the Performance console. You use the System Monitor snap-in to track resource use and network throughput. You use the Performance Logs AndAlerts snap-in to collect performance data over time from the local or a remote com-puter or to have Windows XP alert you when a particular performance threshold iscrossed.

After this lesson, you will be able to

■ Use System Monitor to monitor resource usage

■ Add counters to System Monitor

■ Use Performance Logs And Alerts to track a computer’s performance

■ Establish a baseline for performance data

■ Identify and resolve bottlenecks

Estimated lesson time: 30 minutes

How to Use System Monitor

To access the Performance console, click Start, click Control Panel, click PerformanceAnd Maintenance, click Administrative Tools, and then double-click the Performanceshortcut. The Performance console contains the System Monitor snap-in and the Per-formance Logs And Alerts snap-in (see Figure 19-5).

F19us05

Figure 19-5 The System Monitor snap-in displays counter values in a graph by default.

Lesson 2 Using the Performance Console

19-14 Chapter 19 Monitoring and Optimizing System Performance

You use System Monitor to collect and view real-time data about memory, disk, pro-cessor, network, and other activity on your computer or on remote computers. You canview this data in a graph, a histogram, or a report. To change the display, you can clickthe appropriate icon, as shown in Figure 19-5, or use the following key combinations:Ctrl+G for the graph, Ctrl+B for the histogram, and Ctrl+R for the report.

Note A histogram is a chart that consists of horizontal or vertical bars. The widths or heights of these bars represent the values of certain data.

Monitoring resources on your computer and overall system performance can help youto do the following:

■ Evaluate how well your computer is currently performing

■ Detect and eliminate bottlenecks to improve performance

■ Look for trends to plan for future growth and upgrades

■ Evaluate the effects of tuning and configuration changes on your computer

The Performance tool classifies information in the following areas:

Object An object represents a major system component (hardware or software) ofthe computer or operating system. Examples of objects include physical disks, proces-sor, and memory.

Instance Each occurrence of an object is considered an instance. For example, ifthere are two processors on a computer, there are two processor instances. If there arethree hard disks on a computer, each disk is represented by a separate instance. Not allobjects have multiple instances. If there is only one instance, the Performance snap-inshows a dash for the Instance value.

Counter A counter is a particular aspect of an object that System Monitor can mea-sure. For example, the physical disk object contains the following counters:

❑ Percentage Disk Read Time

❑ Average Disk Bytes Per Read

❑ Disk Reads Per Second

System Monitor helps you gauge a computer’s efficiency and locate and resolve currentor potential problems. You monitor resources on your computer by selecting objects inSystem Monitor. A set of counters exists for each object; Table 19-3 describes some ofthe available objects.

19-15

When you first start the Performance tool, the graph displays three counters by default:

Pages/sec Represents the rate at which pages are read from or written to disk duringvirtual memory operations. Consistently high values can indicate that not enoughmemory is present on a computer.

Avg. Disk Queue Length Represents the average number of read and write requestsqueued for the selected disk. Consistent values above 0 means that requests are back-ing up, which might indicate not enough memory or a slow disk system.

%Processor Time Represents the percentage of elapsed time that the processorspends executing nonidle tasks. Consistently high values (exceeding approximately 80percent) might indicate that the processor is slowing down your computer.

How to Add Counters

Adding counters to an object (such as those described in Table 19-3) allows you totrack certain aspects of the object. The three default counters loaded with System Mon-itor actually do a very good job of representing the basic aspects of a computer’s per-formance. Of course, they are only three of the hundreds of counters that are available.The counters that you monitor depend on whether you are trying to collect generalbaseline information, troubleshoot a performance problem, diagnose an issue with anapplication, and so on. The following steps allow you to add counters to an object inSystem Monitor:

1. At the bottom of the Performance console, right-click Counter and click AddCounters.

The Add Counters dialog box appears.

2. In the Performance Object list box, select the object for which you want to addcounters.

3. Ensure that Select Counters From List is selected.

You can add all counters, but that usually provides more information than youneed or can interpret.

4. Select a counter from the list, and click Add.

Table 19-3 Partial List of Available Objects in System Monitor

Object Description

Cache Used to monitor the file system cache used to buffer physical device data

Memory Used to monitor the physical and virtual memory on the computer

PhysicalDisk Used to monitor a hard disk as a whole

Processor Used to monitor CPUs

Lesson 2 Using the Performance Console

19-16 Chapter 19 Monitoring and Optimizing System Performance

For an explanation of a counter, select it and then click Explain.

Tip If you want to add several counters at the same time, you can hold down Ctrl to select individual counters from the list. You can hold down Shift if you want to select several counters in a row, and click the first in the list you want and then click the last in the list that you want to select. All counters listed between the first and last you clicked are automatically selected.

5. When you have completed your selection of objects and counters, click Close toreturn to the Performance console.

Table 19-4 explains a few of the counters that you might find useful for evaluating yourcomputer’s performance.

Table 19-4 Partial List of Counters That Are Available in System Monitor

Counter Description

Under Processor, choose %Processor Time

Indicates the percentage of time that the processor spends execut-ing a nonidle thread, which is the percentage of time that the pro-cessor is active. During some operations this might reach 100 percent. Periods of 100 percent activity should occur only occasion-ally. This counter is the primary indicator of processor activity. Sus-tained values over 80 percent indicate a potential processor bottleneck.

Under Processor, choose %Interrupt Time

Indicates the time that the processor spends receiving and servicing hardware interrupts during sample intervals. This value is an indica-tor of the activity of devices that generate interrupts (such as the system clock, mouse, and disk drivers). Devices like these typically interrupt the processor when they complete a task or require the processor’s attention. If the %Processor Time value is greater than 90 percent, and the %Interrupt Time value is greater than 15 per-cent, this processor is probably in need of assistance to handle the interrupt load.

Under Processor, choose % DPC Time

Indicates how much time the processor is spending processing DPCs. DPCs are software interrupts or tasks that require immediate processing, causing other tasks to be handled at a lower priority. DPCs represent further processing of client requests.

Under System, choose Processor Queue Length

Indicates the number of threads in the processor queue. There is a single queue for processor time, even on computers with multiple processors. A sustained processor queue of greater than two threads usually indicates that the processor is slowing down the overall system performance.

19-17

Exam Tip Memorize the counters mentioned in this chapter, and understand the values of each counter that indicate a potential problem. In particular, you should remember the three default counters used in System Monitor: Pages/sec, Avg. Disk Queue Length, and %Proces-sor Time.

How to Use Performance Logs And Alerts

Performance Logs And Alerts allows you to log counter information to a file and to trig-ger alerts that are based on configured events. You can automatically collect perfor-mance data from the local computer or from remote computers. You can view the

Under Memory, choose Pages/sec

Indicates the number of pages that were either read from disk or written to disk to make room in physical memory for other pages. This counter is the primary indicator of whether the computer has sufficient memory. An average value in excess of 20 can indicate insufficient memory in the computer.

Under Memory, choose Available Bytes

Indicates the amount of physical memory that is unallocated in the computer. Does not include any memory that is allocated to work-ing sets or file system cache.

Under Paging File, choose %Usage

Indicates the percentage of the paging file that is currently in use.

Under Paging File, choose %Usage Peak

Indicates the peak percentage of the paging file in use.

Under Cache, choose Copy Read Hits %

Indicates the percentage of time that information was found in the file system cache and did not have to be read from disk during a file read operation (typically used by file systems and during small network transfers). A low value (lower than 70 percent) indicates that Windows might not have enough physical memory to keep up with the demands.

Under Logical Disk, choose %Free Space

Indicates the ratio of free disk space that is available to total usable disk space on a particular logical disk.

Under Physical Disk, choose %Disk Time

Indicates the percentage of time that the selected physical disk is busy servicing read or write requests. If this value is consistently over 50 percent, the hard disk is having trouble keeping up with the load that is being placed on it.

Under Physical Disk, choose Avg. Disk Queue Length

Indicates the average number of both read and write requests that are queued for the selected disk. If this value averages 2 or more, the disk is a bottleneck.

Table 19-4 Partial List of Counters That Are Available in System Monitor

Counter Description

!

Lesson 2 Using the Performance Console

19-18 Chapter 19 Monitoring and Optimizing System Performance

logged data from System Monitor, or you can export it to a spreadsheet program or adatabase, such as Structured Query Language (SQL).

The Performance Logs And Alerts node in the Performance console (see Figure 19-6)contains three subsections:

Counter Logs Log activity for selected counters at regular intervals

Trace Logs Log activity for selected counters when a particular event occurs

Alerts Log activity and can notify a user when a particular counter exceeds a certainthreshold

F19us06

Figure 19-6 Use the Performance Logs And Alerts snap-in to track performance over time or alert you to performance problems.

How to Enable Performance Logging

To enable performance logging, use these steps:

1. In the Performance window, expand Performance Logs And Alerts.

2. Right-click Counter Logs, and select New Log Settings.

3. In the New Log Setting dialog box, enter the name for the log and click OK.

4. On the General tab, add the counters that you want to log. Modify the samplinginterval if necessary.

5. On the Log Files tab, you can modify the name and location of the log file, as wellas the type of file if desired.

6. On the Schedule tab, configure the start and stop times for logging. You can man-ually stop and start logging, or you can configure logging to start and stop at spec-ified times.

7. Click OK to save the log configuration.

19-19

Real World Capture Performance Data from a Remote ComputerTo get a real picture of the performance of a computer, it is best if you use a dif-ferent computer to monitor performance than the computer that is being moni-tored. The reason for this is that the Performance console itself uses some systemresources. To use System Monitor or Performance Logs And Alerts to monitor aremote computer, all you have to do is select the remote computer when you addcounters. In the Add Counters dialog box, click Select Counters From Computer,and then select the computer from the drop-down list (or type the UNC path forthe computer).

How to View Performance Data from a Log

After you create a log, you can load the log into the Performance console and view itthe same way that you would view real-time performance data. To view a performancelog, follow these steps:

1. In the Performance console, click System Monitor, right-click the data display, andthen select Properties.

2. In the System Monitor Properties dialog box, on the Source tab, select Log Files.Click Add, and enter the name of the log file that you want to view. Click OK tocontinue.

3. Right-click the data display, and then select Add Counters.

4. Add the counters that you want to view, and then click OK. The available countersare limited to those that are present in the log.

How to Configure an Alert

In addition to using other monitoring techniques, you can use alerts to notify users oradministrators when conditions exceed preset criteria. For example, you can configurean alert to send a message to the administrator when processor utilization exceeds 80percent.

When an alert is triggered, you can perform the following actions:

■ Log an entry in the application event log. This option is enabled by default.

■ Send a network message to a particular user.

■ Start a performance log that can further monitor the alert condition.

■ Run a program that can be used to launch any application program. You can usethis option to launch a script that would send e-mail to the administrator.

Lesson 2 Using the Performance Console

19-20 Chapter 19 Monitoring and Optimizing System Performance

To configure an alert, follow these steps:

1. In the Performance console, expand Performance Logs And Alerts.

2. Right-click the Alerts folder, and select New Alert Settings.

3. Enter a name for the alert, and click OK.

4. On the General tab, add the counter or counters and the alert value.

5. On the Action tab, configure the action or actions to be performed when an alertis triggered.

6. On the Schedule tab, configure the start and stop times for when the alert shouldbe scanned. You can turn scanning on and off manually or configure scanning tooccur on a schedule.

7. Click OK to create the alert.

How to Establish a Baseline for Performance Data

When you are ready to begin monitoring the resources on your computer, the firstthing you need to do is establish a baseline. A baseline is a measurement derived fromcollecting data over an extended period of time. The data should reflect typical typesof workloads and user connections but should also include any unusual activity thatmight occur. The baseline represents resource usage under normal conditions.

After you collect data on performance over an extended period of time, with datareflecting periods of low, average, and high usage, you can determine what is accept-able performance for your computer, and that determination becomes your baseline.You use the baseline to determine when bottlenecks are developing or to watch forchanges in usage patterns. Determining bottlenecks will help you in troubleshootingproblems that might arise. Watching for changes in usage patterns will help you planfor the future.

On the CD At this point, you should watch the multimedia presentation “Creating a Perfor-mance Baseline” included in the Multimedia folder on the CD accompanying this book.

How to Identify and Resolve Bottlenecks

Deviations from your baseline are good indicators of performance problems. A bottle-neck exists if a particular component’s limitation is slowing the entire system perfor-mance. Even if one component in your computer is heavily used, if the othercomponents or the system as a whole are not slowed down, there is no bottleneck.

19-21

If you discover a bottleneck on your computer, here are some basic suggestions to helpyou solve the problem:

■ If paging values are high (meaning that Windows is transferring pages of informa-tion from physical memory to disk more than you would expect), identify pro-cesses that are using the most memory. To do this, use the Processes tab of TaskManager and sort by the Mem Usage column. Stop any unnecessary applicationsor processes, and consider disabling the underlying service. For example, if a pro-gram running in the background uses a lot of memory and it is a program you donot really need, disable the program from starting with Windows.

■ If you see high processor utilization, see if you can determine which applicationsare consuming the most processor time. To do this, use the Processes tab of TaskManager and sort by the CPU column. If you do not need an application that isconsuming processor time, close the application. If an application seems to beconsuming too much processor time for a long period (in other words, not justwhen the program is starting up or performing an intensive process), there mightbe a problem with the application. Stop the application and start it again, or restartthe computer and then restart the application. If the application continues to con-sume excessive amounts of processor time, there might be a problem with theapplication.

■ If you continue to see high processor utilization, and the programs consuming themost processor time are programs you use regularly, you should consider upgrad-ing to a faster processor.

■ If you have programs consuming processor time that are multithreaded programs,consider installing a second processor. You can often gain more effective speedwith a dual processor configuration than with a faster single processor.

■ If you see high processor utilization, but do not discover that programs are con-suming too much processor time, you should use System Monitor to check the %Interrupts value. It is possible that a malfunctioning piece of hardware is trying toooften to interrupt the processor.

■ If you see a high disk queue value, but do not see high paging file use, the bot-tleneck is more likely a slow hard disk than low memory. Consider adding a fasterdisk.

■ Never make more than one change at a time when trying to resolve a bottleneck,and always repeat monitoring to verify that the change you made actuallyimproved the situation.

Lesson 2 Using the Performance Console

19-22 Chapter 19 Monitoring and Optimizing System Performance

Practice: Using System Monitor

In this practice, you use System Monitor to monitor system resources. You add objectsand counters to control what is being monitored, and you then view the three views—graph, histogram, and report—for output.

1. Click Start, click Control Panel, and then click Performance And Maintenance.

2. Click Administrative Tools, and then double-click the Performance shortcut.

Windows XP Professional starts the Performance console with the System Monitorselected.

3. What objects and counters are monitored by default?

4. Under the graph, right-click Counter, and then click Add Counters.

Windows XP Professional displays the Add Counters dialog box.

5. Which performance object and counter are selected by default?

6. In the Select Counters From list, select Interrupts/Sec, and then click Explain.

Windows XP Professional displays an Explain Text dialog box indicating thatInterrupts/Sec is the average number of hardware interrupts that the processorreceives and services each second.

7. Close the Explain Text window.

8. Click Add to add the Interrupts/Sec counter to the Processor object.

9. In the Performance Object list box, select Paging File.

10. Under Select Counters From List, ensure that %Usage is selected, and then clickAdd to add the Paging File object with the %Usage counter.

11. Close the Add Counters dialog box.

12. Press Ctrl+B to view a histogram.

13. Press Ctrl+R to view a report.

14. Press Ctrl+G to return to a graph.

15. Close the Performance console.

19-23

Lesson Review

Use the following questions to help determine whether you have learned enough tomove on to the next lesson. If you have difficulty answering these questions, reviewthe material in this lesson before beginning the next lesson. You can find answers tothese questions in the “Questions and Answers” section at the end of this chapter.

1. Which of the following monitoring tools are included in the Performance console?(Choose all answers that are correct.)

a. System Monitor snap-in

b. Task Manager snap-in

c. Performance Logs And Alerts snap-in

d. Task Scheduler

2. Why should you monitor resources and overall system performance?

3. What is a baseline, and what is a bottleneck?

4. Why do you need to determine a baseline when you monitor system resourcesand system performance?

Lesson Summary

■ The Performance console contains the System Monitor snap-in and the Perfor-mance Logs And Alerts snap-in. The System Monitor snap-in allows you to moni-tor the performance of your computer or other computers on the network.

Lesson 2 Using the Performance Console

19-24 Chapter 19 Monitoring and Optimizing System Performance

■ The System Monitor snap-in provides performance objects that consist of countersfor collecting data. You can add any of hundreds of counters, each of which mea-sures a particular aspect of system performance.

■ The Performance Logs And Alerts snap-in records performance data and systemalerts on your local computer or from remote computers.

■ A baseline is a measurement derived from collecting data over an extended periodof time that represents resource usage under normal conditions.

■ A bottleneck is any component that slows down the entire system’s performance.

Case Scenario ExerciseIn this exercise, you will read a scenario about using System Monitor to measure sys-tem performance, and then answer the question that follows. If you have difficultycompleting this work, review the material in this chapter before beginning the nextchapter. You can find answers to these questions in the “Questions and Answers” sec-tion at the end of this chapter.

Scenario

You are an administrator working for a company named Fabrikam, Inc., a regionalpublic relations firm with its headquarters in Dallas, Texas, and several branch loca-tions throughout the country. You are working with Pat, a user in the company’saccounting department (which is located in the main office). Pat recently noticed thather computer’s performance has decreased, and it is functioning at unacceptably slowlevels when running resource-intensive applications. The computer is configured asfollows:

■ Processor: Pentium 4 2.8 GHz

■ RAM: 256 MB

■ Hard disk: 12 GB

Questions

1. You want to monitor memory, processor, and disk usage over the course of a nor-mal day’s activity on Pat’s computer. Which tool should you use to do this?

19-25

2. What objects and counters would you select?

3. At the end of the day, you use System Monitor to view the log created on Pat’scomputer. You note the following key average counter values:

❑ Memory, Pages/sec: 92

❑ Processor, %Processor Time: 35 percent

❑ Physical Disk, %Disk Time: 73 percent

What do you suspect is causing the performance problem? How would youresolve it?

Troubleshooting LabIn this lab, you will create a performance log on your own computer and then read theresults.

To create a performance log, use the following steps:

1. Click Start, and then click Control Panel.

2. In the Control Panel window, click Performance And Maintenance.

3. In the Performance And Maintenance window, click Administrative Tools.

Troubleshooting Lab

19-26 Chapter 19 Monitoring and Optimizing System Performance

4. In the Administrative Tools window, double-click Performance.

5. In the Performance window, expand Performance Logs And Alerts.

6. Right-click Counter Logs, and select New Log Settings.

7. In the New Log Setting dialog box, type My Performance for the name for thelog and click OK.

8. In the My Performance dialog box, on the General tab, use the Add Counters but-ton to add the following counters:

❑ Memory: Pages/sec

❑ Paging File (_Total): %Usage

❑ Processor: %Processor Time

❑ System: Processor Queue Length

❑ Physical Disk: Disk Reads/sec

❑ Physical Disk: Disk Writes/sec

❑ Physical Disk: Avg. Disk Queue Length

9. On the Schedule tab, configure the start time for five minutes in the future. In theStop Log section, click After, and then set the stop time for one hour from now.

10. Click OK to save the log configuration.

Windows displays a dialog box asking whether you want to create the new logfile.

11. Click Yes.

12. In the Performance window, under Performance Logs And Alerts, click CounterLogs.

13. In the right-hand pane, what do you notice about the My Performance log?

14. While the log is recording, you should continue to use your computer as you nor-mally would. Be sure to run multiple applications (you can even play pinball—afairly resource-hungry program).

15. After one hour has elapsed, return to the Performance window.

The My Performance log icon should now be red, indicating that the log isstopped.

19-27

16. Click System Monitor.

17. Press CTRL+L (or click the View Log Data button) to open the System MonitorProperties dialog box with the Source tab showing.

18. Click Log Files.

19. Click Add.

20. Locate the My Performance log file. The default location for log files is C:\PerfLogs.Click OK.

21. In the Performance window, add each of the counters that you configured the logto monitor.

22. Click the View Report button (or press CTRL+R).

23. Record the values for each counter in the following table.

24. Do you notice any values that indicate a bottleneck? If so, list the values andexplain what you would do to troubleshoot the problem.

25. Close the Performance window.

Object: Counter Value

Memory: Pages/sec

Paging File (_Total): %Usage

Processor: %Processor Time

System: Processor Queue Length

Physical Disk: Disk Reads/sec

Physical Disk: Disk Writes/sec

Physical Disk: Avg. Disk Queue Length

Lesson 2 Using the Performance Console