Linux命令-vmstat
Contents
vmstat用于统计虚拟内存
能够获取的信息包括
- 正在运行的进程个数
- CPU的使用情况
- CPU接收的中断个数
- 调度器执行的上下文切换次数
一个典型的输出为
输出含义为:
VM Mode
- Procs:
- r: 运行的进程数
- b: sleep的进程数
- Memory
- swpd: 虚拟内存使用量
- free: 空闲内存量
- buff: 缓冲区的内存量
- cache: 缓存内存量
- inact: the amount of inactive memory. (-a option)
- active: the amount of active memory. (-a option)
- 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 : percentages of total CPU time.
- us: Time spent running non-kernel code. (user time, including nice time)
- sy: Time spent running kernel code. (system time)
- id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
- wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
- st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.
Disk Mode
- Reads
- total: Total reads completed successfully
- merged: grouped reads (resulting in one I/O)
- sectors: Sectors read successfully
- ms: milliseconds spent reading
- Writes
- total: Total writes completed successfully
- merged: grouped writes (resulting in one I/O)
- sectors: Sectors written successfully
- ms: milliseconds spent writing
- IO
- cur: I/O in progress
- s: seconds spent for I/O
Author hlday
LastMod 2022-05-25