# vmstat -h
Usage:
vmstat [options] [delay [count]]
Options:
-a, --active active/inactive memory
-f, --forks number of forks since boot
-m, --slabs slabinfo
-n, --one-header do not redisplay header
-s, --stats event counter statistics
-d, --disk disk statistics
-D, --disk-sum summarize disk statistics
-p, --partition <dev> partition specific statistics
-S, --unit <char> define display unit
-w, --wide wide output
-t, --timestamp show timestamp
-h, --help display this help and exit
-V, --version output version information and exit
For more details see vmstat(8).
procs
r 表示运行队列(就是说多少个进程真的分配到CPU),当这个值超过了CPU数目,就会出现CPU瓶颈
b 表示阻塞的进程
memory
swpd 虚拟内存已使用的大小
free 空闲的物理内存的大小
buff Linux/Unix系统是用来存储,目录里面有什么内容,权限等的缓存
cache 直接用来记忆打开的文件,给文件做缓冲
swap
si 每秒从磁盘读入虚拟内存的大小,如果这个值大于0,表示物理内存不够用或者内存泄露了,要查找耗内存进程解决掉
so 每秒虚拟内存写入磁盘的大小,如果这个值大于0,同上
io
bi 块设备每秒接收的块数量,这里的块设备是指系统上所有的磁盘和其他块设备,默认块大小是1024byte
bo 块设备每秒发送的块数量
system
in 每秒CPU的中断次数,包括时间中断
cs 每秒上下文切换次数
cpu
us 用户CPU时间
sy 系统CPU时间,如果太高,表示系统调用时间长,例如是IO操作频繁。
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.
使用
# vmstat 2 1 // 2:表示每个两秒采集一次服务器状态,1:表示只采集一次
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
2 0 546784 1817896 0 6388472 0 0 2 45 0 0 5 2 93 0 0
We use cookies and similar methods to recognise visitors and remember preferences. We also use them to measure
campaign effectiveness and analyse site traffic.
By selecting 'Accept', you consent to the use of these methods by us and trusted third parties.