KatInterview

Pinpointing a Storage Bottleneck on a Slow Production Host

System DesignModel answer
EasyModel answerSystem Designlinuxperformanceiostat

Last updated

Walk through how to confirm whether disk I/O is slowing a service, find which process drives it, characterize the workload, and propose measured fixes.

Users report that a backend service has become sluggish, and you suspect the storage layer. You have shell access to the host, but you are not told what kind of disk it uses (local NVMe, SATA SSD, spinning disk, network-attached volume) or which filesystem is mounted.

Describe how you would investigate. Your answer should cover:

  1. How you would use system tools such as iostat to decide whether storage is actually the bottleneck.
  2. How you would find out which process or workload is generating the I/O.
  3. How you would characterize the workload (reads vs. writes, random vs. sequential, request size, concurrency, sync behavior).
  4. How caching and durability settings change what you observe.
  5. How you would decide on a fix and verify that it worked.

Avoid relying on a single universal threshold for utilization or latency. Explain how you would interpret the numbers for the storage stack you actually find.

Hints

Hint 1

Start by separating symptoms: is the application waiting on I/O (high iowait, processes in D state, high per-request latency), or is it CPU, memory, or network bound?

Hint 2

Per-device latency (await, or r_await/w_await), queue depth (aqu-sz), request size, and IOPS/throughput together tell you more than %util alone, because %util is misleading on devices that serve many requests in parallel.

Hint 3

Attribute I/O to processes with tools like pidstat -d, iotop, or biolatency/biosnoop, then use fio to reproduce the workload shape and compare against the device's known capability to see how much headroom exists.