vmstat - Report virtual memory statistics
vmstat [options] [delay [count]]
Options you will use
delay- seconds between updates. Without it, one line of averages since boot is printed.
count- number of updates. With a delay and no count, runs until interrupted.
-w, --wide- wide output
-S, --unit- k K m M for the memory columns
Examples
$ vmstat 1 5five samples, one second apart - ignore the first line, it is the since-boot average
Gotchas
- Procs: r = runnable (running or waiting for a CPU), b = in uninterruptible sleep (D state).
- Memory (KiB): swpd used swap, free idle memory, buff buffers, cache page cache. Swap: si/so KiB/s swapped in/out - sustained non-zero so means memory pressure.
- IO: bi/bo blocks/s received from/sent to block devices. System: in interrupts/s, cs context switches/s.
- CPU (% of total time): us user, sy system, id idle, wa waiting for block I/O, st stolen from a VM, gu guest.
Taught in
Try vmstat in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.