NOTE

vmstat

1. Usage 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 n

Operating Systems / LinuxCreated Updated 1 min readhistorical

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.

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub