Linux vmstat 命令参数详解
Linux vmstat 命令参数详解vmstat n m :每隔n秒钟刷新,抓取m次数后退出。
[Oracle@linuxidc properties]$ vmstat 2 3
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 96 655968 278912 2117884 0 0 0 10 1 1 18 2 80 0 0
1 0 96 655968 278912 2117884 0 0 0 0 1011 694 0 0 100 0 0
0 0 96 655968 278912 2117884 0 0 0 34 1013 338 0 0 100 0 0
FIELD DESCRIPTION FOR VM MODE
Procs
r: The number of processes waiting for run time. 处于运行队列中的内核线程数目(进程数)。
b: The number of processes in uninterruptible sleep. 置于等待队列(等待资源、等待输入/输出)的内核线程数目。 处于block队列中不可中断的进程数
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). 从磁盘到内存的交换页数目 (单位/S)
so: Amount of memory swapped to disk (/s). 从交换内存到磁盘的交换页数目(单位/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) 用户时间 处于用户模式的时间百分比
sy: Time spent running kernel code. (system time) 系统时间 处于内核模式的时间百分比
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. CPU空闲时间 空闲时间百分比
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. CPU 空闲时间,在此期间系统有未完成的磁盘/NFS I/O 请求
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. 来自于虚拟机偷取的CPU所占的百分比 (这个不会翻译...)
FIELD DESCRIPTION FOR 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
----------------------------------------------------------------------------------------------------------
NOTICE:
procs r: 运行的进程比较多,系统很繁忙
bi/bo: 磁盘写的数据量稍大,如果是大文件的写,10M以内基本不用担心,如果是小文件写2M以内基本正常
cpu us: 持续大于50%,服务高峰期可以接受, 如果长期大于50 ,可以考虑优化
cpu sy: 现实内核进程所占的百分比,这里us + sy的参考值为80%,如果us+sy 大于 80%说明可能存在CPU不足。
cpu wa: 列显示了IO等待所占用的CPU时间的百分比。这里wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的, 也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)。
cpu id: CPU 空闲时所占百分比 平常持续小于50,服务高峰期可以接受。
更多内容:http://www.网站建设