Examining and Tuning Disk Performance
Windows 2000 includes counters that monitor the activity of physical disks (including removable media drives) and logical volumes. The PhysicalDisk object provides counters that report physical-disk activity; the LogicalDisk object provides counters that report statistics for logical disks and storage volumes. These counters measure disk throughput, queue length, usage, and other data. The interrelationships between different aspects of disk performance make it useful to monitor them simultaneously. The operating system enables a driver called Diskperf.sys to activate the disk monitoring counters. By default, the operating system activates only the PhysicalDisk performance counters. Users must activate the LogicalDisk counters manually using the diskperf command. See the following procedure for activating disk counters with the diskperf command.
To use the diskperf command to enable LogicalDisk object counters
- At the command prompt, type diskperf – yv
The diskperf command takes the following syntax:
diskperf [ – y [ d | v ] | – n [ d | v ]] [\\ computer_name ]
Use – y to enable counters and – n to disable counters. To specify the type of counters, include d for physical disk drives or v for logical disk drives or storage volumes. When the operating system starts up, it automatically sets the diskperf command with the – yd switch to activate physical disk counters. For more information about using the diskperf command, type diskperf – ? at the command prompt.
The PhysicalDisk object counters provide data on activity for each of the physical disks in your system; the LogicalDisk object counters provide data on logical volumes in your system. The System Monitor user interface identifies physical disks by number starting with 0. If you are monitoring logical disks, it identifies these by drive letter. For logical disks consisting of multiple physical disks, the disk instances might appear as disk 0 C and disk 1 C, where logical drive C: consists of physical drives 0 and 1.
When monitoring logical volumes, remember that they might share a physical disk and your data might reflect contention between them. If you have a spanned volume or striped volume with disk controllers that support hardware-enabled redundant array of independent disks (RAID) volumes, the counters report physical disk data for all disks in the stripe as if they are a single disk. Software-enabled RAID-5 volumes are available only on computers running Microsoft Windows 2000 Server.
Use the counters described in Table 30.1 to measure disk space, disk throughput, and disk utilization.
Table 30.1 Performance Objects and Counters for Disk Monitoring
Counter |
Description |
---|---|
LogicalDisk\% Free Space |
Reports the percentage of unallocated disk space to the total usable space on the logical volume. When calculating the _Total instance, the %Free Space counters recalculate the sum as a percentage for each disk. |
LogicalDisk|PhysicalDisk\Avg. Disk Bytes/Transfer |
Measures the size of input/output (I/O) operations. The disk is efficient if it transfers large amounts of data relatively quickly. |
LogicalDisk|PhysicalDisk\Avg. Disk sec/Transfer |
Indicates how fast data is being moved (in seconds). Measures the average time of each data transfer, regardless of the number of bytes read or written. Shows the total time of the read or write, from the moment it leaves the Diskperf.sys driver to the moment it is complete. |
LogicalDisk|PhysicalDisk\Avg. Disk Queue Length |
Tracks the number of requests that are queued and waiting for a disk during the sample interval, as well as requests in service. As a result, this might overstate activity. |
LogicalDisk|PhysicalDisk\Current Disk Queue Length |
Indicates the number of disk requests that are currently waiting as well as requests currently being serviced. Subject to wide variations unless the workload has achieved a steady state and you have collected a sufficient number of samples to establish a pattern. |
LogicalDisk|PhysicalDisk\Disk Bytes/sec |
Indicates the rate at which bytes are transferred and is the primary measure of disk throughput. |
LogicalDisk|PhysicalDisk\Disk Transfers/sec |
Indicates the number of read and writes completed per second, regardless of how much data they involve. Measures disk utilization. |
LogicalDisk\Free Megabytes |
Reports the amount of bytes on the disk that are not allocated. |
LogicalDisk|PhysicalDisk\Split IO/sec |
Reports the rate at which the operating system divides I/O requests to the disk into multiple requests. A split I/O request might occur if the program requests data in a size that is too large to fit into a single request or if the disk is fragmented. Factors that influence the size of an I/O request can include application design, the file system, or drivers. A high rate of split I/O might not, in itself, represent a problem. However, on single-disk systems, a high rate for this counter tends to indicate disk fragmentation. |
LogicalDisk|PhysicalDisk\% Disk Time |
Reports the percentage of time that the selected disk drive is busy servicing read or write requests. Because this counters data can span more than one sample, and consequently overstate disk utilization, compare this value against % Idle Time for a more accurate picture. |
LogicalDisk|PhysicalDisk\% Disk Write Time |
Reports the percentage of time that the selected disk drive is busy servicing write requests. |
LogicalDisk|PhysicalDisk\% Disk Read Time |
Reports the percentage of time that the selected disk drive is busy servicing read requests. |
LogicalDisk|PhysicalDisk\% Idle Time |
Reports the percentage of time that the disk system was not processing requests and no work was queued. Notice that this counter, when added to % Disk Time, might not equal 100 percent, because % Disk Time can exaggerate disk utilization. |
When working with the disk-time or disk-queue length counters, be aware of the following limitations that might yield unlikely counter values.
The % Disk Read Time and % Disk Write Time counters can exaggerate disk time. This is because they report busy time based on the duration of the I/O request, which includes time spent in activities other than reading to or writing from the disk. It then sums up all busy time for all requests and divides it by the elapsed time of the sample interval. If multiple requests are in process at a time, the total request time is greater than the time of the sample interval; as a result, reported disk utilization can exceed actual utilization.
Counter values that report sums can be misleading for multidisk systems. When you look at the _Total instance for the % Disk Time or disk-queue counters on a multidisk system, the counters report values totaled for all disks and do not divide these totals over the number of disks in use. Therefore, in a system with one idle disk and one disk that is 100 percent busy, it can appear as if all disks are 100 percent busy.
The following sections describe how you can use disk-monitoring counters to observe available space on the disk and to observe the efficiency of disk operations as you become acquainted with your systems disk performance.