Chinaunix首页 | 论坛 | 博客
  • 博客访问: 84363
  • 博文数量: 37
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 386
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-11 11:33
文章分类

全部博文(37)

文章存档

2011年(1)

2010年(30)

2009年(6)

我的朋友

分类: LINUX

2010-03-02 19:45:27

VMSTAT 命令详解(red hat 4.7):
最近看到网上很多关于vmstat的详解
但是可以看出都是一大抄来的
毫无原创性
/////////////////
SQL> !vmstat 3
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 2  0      0  77268  66972 304828    0    0     2     8  505     9  0  0 99  0
 0  0      0  77268  66972 304828    0    0     1    39 1010    22  0  0 100  0
 0  0      0  77268  66972 304828    0    0     0     8 1010    15  0  0 100  0
上面是我的测试机子vmstat后的结果.
可以看出系统处于高闲置状态,因为是测试机子.
下面 man vmstat 看一下,
其中有这样描述:
FIELD DESCRIPTION FOR VM MODE
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)
    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, shown as zero.
以上这段描述很重要的。
下面解释一下:
FIELD DESCRIPTION FOR VM MODE
Procs
    r: 正在等待运行的进程数。
    b: 处在睡眠(不可中断)状态的进程数。
Memory
    swpd: 已使用的虚拟内存(交换区)的总量。
    free: 空闲的物理内存总量(同上,单位K)。
    buff: 已被作为缓冲区使用的内存总量(K)。
    cache: 已被作为缓存使用的内存总量(K)。
    inact: 不活动的内存总量。
    active: 活动的内存总量。
Swap
    si: 从磁盘交换出来的内存数量(每秒)。
    so: 每秒交换到磁盘的内存数量(同上单位:页)。
IO
    bi: Blocks received from a block device (blocks/s).
    bo: Blocks sent to a block device (blocks/s).
System
    in: 每秒的中断数,including the clock.
   cs: The number of context switches per second.(不懂。。。)
CPU
    These are percentages of total CPU time.
    us: 非内核代码(就是用户)的运行时间. (user time, including nice time)
    sy: 内核代码(就是系统)的运行时间. (system time)
    id: 空闲时间(越大越好). Prior to Linux 2.5.41, this includes IO-wait time.
    wa: Time spent waiting for IO(越小越好). Prior to Linux 2.5.41, shown as zero.
阅读(762) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~