vmstat命令解释:查看所有CPU的平均信息;查看cpu队列信息;
vmstat是将如下三个文件信息读取计算并显示
/proc/meminfo
/proc/stat
/proc/*/stat
# vmstat -h
usage: vmstat [-V] [-n] [delay [count]]
-V prints version. # 显示版本
-n causes the headers not to be reprinted regularly. # 只显示一次头部信息(终端一直刷新信息,填满终端窗口时,终端将不在打印头部)
-a print inactive/active page stats. # 打印活动,不活动统计信息
-d prints disk statistics # 磁盘统计
-D prints disk table # 磁盘表信息
-p prints disk partition statistics # 磁盘分区统计信息
-s prints vm table # 内存表信息
-m prints slabinfo # cache信息
-t add timestamp to output # 打印信息,输出时间戳
-S unit size # 输出信息的单位,k,K,m,M
delay is the delay between updates in seconds. # 每隔时间显示
unit size k:1000 K:1024 m:1000000 M:1048576 (default is K)
count is the number of updates. # 显示次数
vmstat显示
~]# vmstat -n 1 5 -t
procs -memory- -swap- -io- -system- -cpu- -timestamp-
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 642692 11800 125248 0 0 23 7 34 46 0 0 100 0 0 2017-04-28 13:38:39 CST
....
procs:
r: The number of processes waiting for run time. # 等待运行的进程数
b: The number of processes in uninterruptible sleep. # 未中断睡眠的进程数
memory:
swpd: the amount of virtual memory used. # 虚拟内存使用量
free: the amount of idle memory. # 空间内存量
buff: the amount of memory used as buffers. # 内存缓冲区使用量
cache: the amount of memory used as 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:These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time) # 用户进程消耗CPU时间的(百分比)
sy: Time spent running kernel code. (system time) # 内核进程消耗CPU时间(百分比)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. # CPU处于空间时间(百分比),包括IO等待时间
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. # IO等待消耗CPU的时间
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. # 从虚拟机偷取的时间
vmstat -d 显示磁盘统计信息