← Memory & Performance
Linux · Memory & Performance
How to use vmstat to monitor performance in Linux
Watch CPU, memory, swap, and I/O together with vmstat, and read the key columns for run queue, blocked processes, and I/O wait.
vmstat gives a compact live view of the whole system. Run it with an interval and ignore the first line (averages since boot). Watch r (run queue), b (blocked), si/so (swap in/out), and wa (I/O wait).
# Sample every 1 second, 5 times
vmstat 1 5
# With a timestamp and wide output
vmstat -t -w 2
# Memory and event counters since boot
vmstat -sLinuxvmstatPerformance