vmstat
Linux · Processes · reference only
What it does
Shows system statistics: processes, memory, swap, input/output, interrupts and CPU usage.
Syntax
vmstat [opciones] [retardo [repeticiones]]
Options and parameters
retardo repeticionesSeconds between samples and number of samples to take.
-aShows active and inactive memory instead of buffers and cache.
-sShows a summary of event counters and memory.
-dShows disk statistics.
-S unidadChanges the memory unit: k, K, m or M.
-tAdds the time to each line.
-wUses a wider format for systems with a lot of memory.
Usage examples
vmstatShows a snapshot with averages since boot.
vmstat 1 3Takes three samples one second apart.
vmstat -sShows the system's memory and event counters.
vmstat -S M 2 5Five samples every 2 seconds with memory in megabytes.
Notes and common mistakes
- The first line shows the average since boot; the following ones reflect the interval.
- Sustained non-zero values in the si and so columns mean the system is using swap.