Lesson 6.17: Finding the bottleneck
'The server is slow' can mean the CPU is busy, memory is short, or processes are waiting for the disk. The tools tell these apart in seconds if you read the right columns: vmstat shows runnable and blocked processes and where CPU time goes, including time spent waiting for I/O; iostat shows how busy each disk is and how long requests wait; pidstat shows which process does the I/O. Then you fix the cause, not the symptom. In the lab the shop is slow while the CPU is mostly idle; you trace it to a report export saturating the data disk and give the export lower I/O priority, now and permanently.
17 min
You will learn to
- Tell CPU, memory and I/O bottlenecks apart
- Read vmstat's r, b and wa columns
- Read iostat -x await and %util
- Find the process doing the I/O with pidstat -d
- Lower a job's I/O priority with ionice and systemd
Key terms
- Load average
- Average number of processes running or waiting, including waiting for disk.
- wa (iowait)
- Share of time the CPU was idle while processes waited for I/O.
- await
- Average time an I/O request takes, queueing included, in milliseconds.
- %util
- Share of time the device was busy; near 100% means saturated.
- I/O scheduling class
- How the kernel prioritises a process's disk access: realtime, best-effort, idle.
← Changing users: su and sudo · All lessons · APT repository trust and pinning →