Linux之vmstat命令解释

上一篇 / 下一篇  2011-11-22 16:19:08

vmstat监视内存性能:该命令用来检查虚拟内存的统计信息,并可显示有关进程状态、空闲和交换空间、调页、磁盘空间、CPU负载和交换,cache刷新以及中断等方面的信息。

【Procs】
r: The number of processes waiting for run time. 运行的和等待(CPU时间片)运行的进程数。 # 这个值也可以判断是否需要增加CPU(长期大于1)。
b: The number of processes in uninterruptable sleep. 处于不可中断状态的进程数。 # 常见的情况是由I/O引起的,b值越高说明I/O越忙。b的值大于3表示I/O性能不好。

【Memory】
swpd: the amount of virtual memory used (kB). 虚拟内存使用量。 
free: the amount of idle memory (kB). 空闲的物理内存。
buff: the amount of memory used as buffers (kB). 作为buffer cache的内存,对块设备的读写进行缓冲。
cache: the amount of memory used as cache. 作为cache的内存,对页数据的交互进行缓冲。

【Swap】
si: Amount of memory swapped in from disk (kB/s). 虚拟内存的页导入(从SWAP DISK导入RAM)。
so: Amount of memory swapped to disk (kB/s). 虚拟内存的页导出(从RAM到SWAP DISK)。
# 如果(Memory)swpd的值不为0,或者比较大,比如超过了100m,只要si、so的值长期为0,系统性能还是正常。

【IO】
bi: Blocks sent to a block device (blocks/s). 写磁盘。
bo: Blocks received from a block device (blocks/s). 读磁盘。
# 随机磁盘读写的时候,这2个值越大(如超出1M),能看到CPU在IO等待的值也会越大。

【System】
in: The number of interrupts per second, including the clock. 每秒产生的中断次数 [设备中断]
cs: The number of context switches per second. 每秒产生的上下文切换次数。
# 这2个值越大,说明内核消耗的CPU会越多。

【cpu】
us: Time spent running non-kernel code, (user time, including nice time). 用户进程使用的时间(percentage of total processor time consumed by user-space)。 # 如果us长期大于50%,需要考虑优化用户的程序。
sy: Time spent running kernel code, (system time). 内核(系统)进程消耗的CPU时间百分比[系统进程使用的时间][系统中断](percentage of total processor time consumed by the kernel)
# 这里us + sy的参考值为80%,如果us+sy 大于 80%说明可能存在CPU不足。
id: Time spent idle, this includes IO-wait time. CPU处在空闲状态时间百分比(percentage of total processor time spent idle)。
wa: Time spent waiting for IO. IO等待消耗的CPU时间百分比(percentage of total processor time spent in I/O wait)。
# wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的,也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)。

TAG:

 

评分:0

我来说两句

日历

« 2024-04-24  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 22096
  • 日志数: 14
  • 建立时间: 2011-06-07
  • 更新时间: 2012-06-04

RSS订阅

Open Toolbar