Storage Performance: Find the Disk Hog with iostat and Throttle It
MediumLFCS Prep15 minUsers say the app server is slow whenever it touches disk. Three services run here, each with its own data disk (loop devices backed by /srv/disks/*.img): search-indexer, media-thumbnailer and log-shipper. One of them is saturating its disk.
1. Find which disk is doing the most I/O and which process is driving it. Write both to /root/case/findings.txt, one per line, as device=<name as iostat shows it, e.g. loop7> and pid=<process ID>.
2. Don't kill it; it's doing real work. Set that one process's I/O scheduling class to idle, so it only gets the disk when nothing else wants it. Leave the other two services running and untouched.
Which service is the heavy one changes on every box, and top shows CPU, not disk, so measure the disks themselves. The ticket is in /root/case/brief.txt.
- Read per-device throughput with iostat and ignore the since-boot first report
- Tie a busy block device to the process doing the I/O
- Change a running process's I/O scheduling class with ionice
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
