Disk Latency

Measuring Disk Latency-Windows Performance Monitor

Windows Performance Monitor - PerfmonPhysical Disk Latency is, in a nutshell, a measure of the delay from when a disk Input/output (I/O) request is created until it’s completed. It determines how fast a computer responds to various tasks and increased latency can be a sign of a problem with the system, or simply that it’s overworked.

In the old days of floppy drives, a disk I/O bottleneck was more obvious. As the drive read data from the disk, the CPU would sit and wait for the data to arrive. Now that the disk is integrated things are more complex, but the I/O bottleneck conundrum still exists and the processor still has to wait for data to physically arrive. As hard disks are mechanical, it has to rotate to the correct sector for a start.

How slow is your System?

As a rule of thumb less than 10 milliseconds is a good time and more than 20 milliseconds shows the system is running slowly, although there are exceptions and this is merely a guide.

Windows Performance Monitor (Perfmon) is the standard means of testing the disk latency and measures the whole latency, including time spent in the hardware, as well as in the Microsoft Port Driver queue. The latter is a potential bottleneck. If a number of processes are in action at once it causes a large storport queue. This forces the IO to a halt until it can be sent to the hardware layers.

Windows Performance Monitor is the standard way of measuring disk performance in Windows. It can capture data over lengthy time periods, does a solid job with averages and is also a solid tool for creating a baseline and doing basic troubleshooting. Perfmon is its accepted nickname and comes from the name of the executable file.

Physical & Logical

Perfmon has two objects related to disk performance: Physical Disk and Logical Disk. The Physical Disk performance object monitors disk drives on the computer. It identifies the instances representing the physical hardware, while the Logical Disk performance object monitors logical partitions and identifies them by their mounting point. Logical volumes can span more than one physical disk.

There are some things Perfmon cannot do, but it is a good, basic, all-purpose tool.

Create Charts and Metrics

Perfmon can be used to create a chart and metrics of the Last, Average, Minimum and Maximum values, which are all useful. When you’re looking for things like memory leak then a sudden dip or spike in the mean line is a clear indicator of an issue.

There are three counters:

  • Read counter
  • Write counter
  • Transfer Counter

The Transfer Counter is the combined average of Read and Write latency. The data is taken at the Partition Manager, so the readings concern the time spent beneath the Partition Manager level. So the latency measurement includes time spent in the Class Driver, Port Driver, Device Miniport Driver, and Disk Subsystem.

The disk can only take a set number of IO requests before it starts a queue and the Windows Performance Monitor includes time spent in queues in the latency measurement.

Bigger Queues, Larger Latency Reading

So bigger queues mean a bigger latency reading, and the queues can occur in the following places:

  • Microsoft Port Driver Queue
  • Vendor Supplied Device Driver Queue.
  • Hardware Queues.

· The hard disk spends time servicing the IO and this, as well as the travel time to the Partition Manager, is included as a queue.

The Port Driver is the last Microsoft component in the chain before the Device Miniport Driver takes over. If there’s a logjam and a queue there because the Device Miniport Driver can’t take more IO at that moment, IO starts to back up and gather on the Port Driver Queue.

RAID

Microsoft’s Port Driver queue is limited only by the RAM and so can grow fast, as the RAM is in a different league to the hard disk in terms of speed, too. This produces large measured latency readings. Queues can be controlled, but in terms of measurement it’s important to simply understand how the queues build up between the Microsoft and proprietary hardware in particular.

For SCSI, as found in a RAID system, Storport tracing can be used to measure latency. This only works to measure the latency beneath the Port Driver, however, and doesn’t apply to time spent above the Storport queue. It’s the lowest level where it’s possible to monitor the latency inside Windows, though, before the IO is passed across to the third-party components.

Understanding Windows Data

It is worth remembering that Windows Performance Monitor simply filters and interprets data provided by other Windows systems. It does not create anything new bar the readings. Understanding the latency of the system can be the first step in speeding up the system, though, and Perfmon averages results and rounds numbers to provide small log files and useful information in a hurry.

For more precise information, there are other, more powerful, tools available. But Windows Performance Monitor is an accessible diagnostic tool that can answer most questions about the disk latency without a full system interruption.

William Thompson is the Marketing Manager at Power Admin, a server monitoring software business in the Kansas City area. You can find him on Google+ and Twitter. William has been a professional in website design, digital marketing and 3D/graphic design for over 20 years.


Posted

in

, , ,

by

Tags: