CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 6 of 7 · 3 min read

Reading the numbers

Reading the numbers

Think of a doctor who looks at temperature, pulse and blood pressure together. One number may be fine while another is not, and the pattern decides the diagnosis. The analogy stops in one place: a patient's numbers have standard ranges, while the right range for a disk depends on its type.

In plain words: A disk is a bottleneck when requests wait for it. The signs are a high utilisation, a latency that is much higher than the device needs for a single request, and a long queue. A latency that is near the device's normal time with a low queue shows that the disk is not the problem. A rising queue and rising latency at the same IOPS show that requests arrive faster than the disk can serve them.

A worked example (made up to show the idea). A flash disk normally answers in 0.1 ms. Server A shows 0.12 ms, a queue depth of 2 and a utilisation of 30%: the disk is fine. Server B shows 8 ms, a queue depth of 64 and a utilisation of 100%: the disk is saturated, since requests wait about 80 times longer than the service time. Server C shows 0.1 ms, a queue depth of 1 and a utilisation of 100% with 10,000 IOPS: this single-threaded workload is limited by its own request rate, and a higher queue depth could give more.

The key lines. First compare the latency with what the device alone gives (from a test with dd or fio). Then check the queue depth. Then check whether the program could issue more requests at once. A slow disk is not always the fault of the disk.

Saturation

A device is saturated when requests arrive faster than it can finish them, so the queue grows and the latency rises above the time of one request alone. The signs are a long queue, high latency, and a throughput that does not rise when the load rises.

Example: a disk that gives 20,000 IOPS at most and receives 30,000 requests per second is saturated, and its queue grows without limit.

Check yourself: 1. What do server A and server B differ in, besides latency? 2. Why is server C not a case of a slow disk? 3. Which measurement tells you what a device can do alone?

Words you will meet

Word Meaning
IOPS I/O operations completed in each second.
Latency Time from the start to the end of one request.
Queue depth Requests in flight at one moment.
Utilisation Share of time with at least one request in flight.
Saturation Requests arrive faster than the device finishes them.

Quick notes

  • Throughput = IOPS x request size. Little's law: in flight = IOPS x latency.
  • /proc/diskstats holds growing counters. Rates need two samples.
  • A sector in the counters is 512 bytes. io_ticks gives the busy time.
  • dd with iflag=direct tests the device with one request at a time.
  • A flash disk needs a higher queue depth to show its full IOPS.
  • A disk is saturated when its queue and latency rise with the load.