NOTE
vmstat
Vmstat reports process, memory, swap, and CPU statistics. These notes focus on fields such as buffer and cache.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Usage
# Sample once every 2s, 3 times in total
vmstat -n 2 3
2. Result

3. Explanation
- buffer and cache: different from buffer and cache in the traditional sense. Memory Management
- buffer: file metadata.
- cache: file data.
- procs
- r: number of processes running and waiting for CPU time slices. Generally no more than twice the total number of CPU cores.
- b: number of processes waiting for resources, such as disk I/O, network I/O, etc.
- cpu
- us: percentage of CPU time consumed by user processes. Long-term >50% means the program needs optimization.
- sy: percentage of CPU time consumed by kernel processes.
- us+sy > 80% means CPU is insufficient.
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub