Skip to content

vmstat Command Cheat Sheet

vmstat (virtual memory statistics) reports information about processes, memory, paging, block IO, traps, and CPU activity.


Synopsis

vmstat [options] [delay [count]]

Basic Usage

Snapshot

vmstat

Continuous Monitoring (Every 1 second)

vmstat 1

Understanding Output Columns

Procs

  • r: The number of runnable processes (waiting for run time).
  • b: The number of processes in uninterruptible sleep.

Memory

  • swpd: Amount of virtual memory used.
  • free: Amount of idle memory.
  • buff: Amount of memory used as buffers.
  • cache: Amount of memory used as cache.

Swap

  • si: Amount of memory swapped in from disk (/s).
  • so: Amount of memory swapped to disk (/s).

IO

  • bi: Blocks received from a block device (blocks/s).
  • bo: Blocks sent to a block device (blocks/s).

System

  • in: The number of interrupts per second, including the clock.
  • cs: The number of context switches per second.

CPU

  • us: Time spent running non-kernel code. (user time, including nice time)
  • sy: Time spent running kernel code. (system time)
  • id: Time spent idle.
  • wa: Time spent waiting for IO.
  • st: Time stolen from a virtual machine.

Options

Display Unit (-S)

Switch to Megabytes.

vmstat -S M

Active/Inactive Memory (-a)

Display active/inactive memory instead of buffer/cache.

vmstat -a

Disk Statistics (-d)

Detailed breakdown of read/writes per disk partition.

vmstat -d