How do you diagnose disk I/O issues on Linux?
Assesses fundamental understanding of Linux Administration conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
Measure latency and utilisation, then find the culprit.
- Space versus inodes: use df -h and df -i. A full inode table also breaks writes.
- Utilisation and latency:
iostat -xz 1 5
iotop -o
pidstat -d 1 5
Look at %util, await, and queue size. High await with low utilisation suggests slow storage, while high %util suggests saturation.
- Find heavy writers: iotop shows per-process I/O, and lsof +D can reveal open files.
- Check for errors: dmesg for I/O resets, smartctl -a /dev/sda for disk health, and mount options such as noatime.
- Filesystem: a full or fragmented filesystem, or a runaway log, can bottleneck. Check and rotate logs.
dstat -d --top-io
Remedies: tune the I/O scheduler, adding mq-deadline or none for SSD and NVMe, add IOPS, move data, or fix the application's write pattern.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.