In the morning the shop website responds slowly. You open top and see that programs barely use the CPU. Look at where its time goes.
See what the CPU is doing
Look at the first three lines of top, then at five vmstat snapshots, one per second.
First, predict
Programs barely use the CPU. Which column of the cpu group in vmstat will be the largest?
Now start the exercise, run the command and compare your prediction with the output.
Programs use a few percent of the CPU, id is near zero, wa is above 90, and the bo column shows thousands. What is going on on the machine?
-
An overloaded CPU would show large us and sy and a queue in the r column. Here us is in single digits, and r is 0.
-
Swap traffic shows in the si and so columns — they are zeros, and
free -mshows Swap 0: the machine has no swap. -
Time taken by the host is the st column, and it is 0.
The CPU is idle: a process is waiting for its write to reach the disk.