Disk latency and I/O
Quick answer
IOPS counts operations per second, throughput counts transferred bytes per second, and latency measures how long an operation takes. A storage system may deliver high throughput while interactive requests suffer high latency.
At 1000 operations per second with 4096 bytes per operation, the illustrative throughput is 4096000 bytes per second. The same throughput can hide very different latencies. Compare request size, queue depth and latency distribution under a comparable workload.
Prepare the practice environment
Run python3 lab-fixtures/performance/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not change live monitoring or services. All supplied records are fictional; live read-only header checks do not retain measurements. Review the lab guide.
Prerequisites
Review: Memory, cache and pressure.
How it works
iostat -x displays extended device statistics such as read/write rates, await (average request time including queueing and service), average queue size and utilization. A device busy percentage near 100 does not universally imply saturation for parallel SSD or RAID devices. Compare read and write latency separately and use application percentiles when available. pidstat -d attributes I/O activity to tasks where accounting permits; buffered writes can be delayed. sar can report live or previously collected samples. Keep interval boundaries and units consistent: KiB is 1024 bytes. The sample uses completed operations and bytes over a fixed interval; the average latency is provided separately, not derived from throughput. Avoid tests on raw disks or production volumes.
Try the examples
500 operations and 4096000 bytes completed in five seconds.
Expected stdout:
100.0 IOPS; 800.0 KiB/sawk -F, 'NR>1 {print $1, $2 "ms", "queue=" $3}' disk.csvLatency and queue growth suggest waiting; identify device and application context before deciding the cause.
Expected stdout:
baseline 2ms queue=1peak 35ms queue=12Optional sysstat VM only; -y skips the since-boot report. Inspect relevant devices without starting a load test.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Never infer latency from throughput alone or run destructive disk benchmarks. Device utilization is not a universal saturation measure.
Practice
Calculate IOPS and KiB/s for 240 operations and 983040 bytes in four seconds. Compare the synthetic latency samples and propose a read-only follow-up.
Related references
Study: iostat, pidstat, sar. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Disk latency and I/O — Knowledge Check
Apply performance-analysis concepts to synthetic fixtures and VM-only scenarios.
240 operations in 4 s equals what?
What does await generally include?
Why is 100% util not universal proof of saturation?
Which command reports task I/O statistics?