Live sampling¶
vmstat 1 5 # one line per second, five samples (first line is average since boot)
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 77464 856060 436780 8533788 0 0 8 100 512 1420 15 12 72 0 0
| Column | Meaning |
|---|---|
r |
runnable processes (compare to CPU count) |
b |
processes blocked in uninterruptible sleep (usually I/O) |
swpd, free, buff, cache |
memory in KB (use -S M for MB) |
si / so |
KB/s swapped in from / out to disk. Non-zero so means real memory pressure |
bi / bo |
blocks read from / written to block devices |
in / cs |
interrupts and context switches per second |
us sy id wa st |
CPU: user, system, idle, I/O wait, stolen |
Sustained r above the core count means CPU contention. b and wa above zero together mean I/O contention. Nonzero si/so means the machine is swapping.
Memory summary¶
vmstat -s # counters in KB since boot
vmstat -s -S M # in MB
The output lists total, used, active, inactive, free, buffer, and cache memory, swap use, CPU tick counters, pages paged and swapped in and out, interrupts, context switches, boot time, and forks.
Per-disk statistics¶
vmstat -d
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
sda 283522 79754 35994362 1344114 1866661 126252 46138486 16030870 0 6507
Per device: completed and merged reads/writes, sectors transferred, milliseconds spent, I/Os in flight (cur), and seconds spent on I/O. For rates and utilisation percentages, iostat is easier to read.
Related: sysstat/sar records the same figures over time.