vmstat输出

 
 
1、linux系统下vmstat输出
 
vmstat的输出分为以下几种模式:
 
(1)、VM MODE (普通选项)
(2)、DISK MODE(-d选项)
(3)、DISK PARTITION MODE(-p选项)
(4)、SLAB MODE (-m选项)
 
(1)、VM MODE
 
  1. # vmstat 2 5
  2. procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
  3. r b swpd free buff cache si so bi bo in cs us sy id wa st
  4. 0 0 0 15117732 162184 1071304 0 0 0 2 0 1 0 0 100 0 0
  5. 0 0 0 15117732 162184 1071304 0 0 0 62 1022 114 0 0 100 0 0
  6. 0 0 0 15117732 162184 1071304 0 0 0 24 1023 115 0 0 100 0 0
  7. 0 0 0 15117732 162184 1071304 0 0 0 24 1022 118 0 0 100 0 0
  8. 0 0 0 15117732 162184 1071304 0 0 0 14 1021 112 0 0 100 0 0
Procs
       r: The number of processes waiting for run time.(等待运行的进程数)
  1. r 列表示运行和等待cpu时间片的进程数,如果长期大于1,说明cpu不足,需要增加cpu。
       b: The number of processes in uninterruptible sleep.(不中断进程数)
  1. b 列表示在等待资源的进程数,比如正在等待I/O、或者内存交换等。
Memory
       swpd: the amount of virtual memory used.(使用的虚拟内存数)
  1. swpd 切换到内存交换区的内存数量(k表示)。如果swpd的值不为0,或者比较大,比如超过了100m,只要si、so的值长期为0,系统性能还是正常
       free: the amount of idle memory.(空闲内存)
  1. free 当前的空闲页面列表中内存数量(k表示)
       buff: the amount of memory used as buffers.(用作buffer的内存数量)
  1. buff 作为buffer cache的内存数量,一般对块设备的读写才需要缓冲。
       cache: the amount of memory used as cache.(用作cache的内存数量)
  1. cache: 作为page cache的内存数量,一般作为文件系统的cache,如果cache较大,说明用到cache的文件较多,如果此时IO中bi比较小,说明文件系统效率比较好。
       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).(从硬盘中导进内存的swap数量,单位:KB/秒)
       so: Amount of memory swapped to disk (/s).(导入硬盘的swap数量,单位:KB/秒)
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.(每秒上下文切换数)
  1. cs列表示每秒产生的上下文切换次数,如当 cs 比磁盘 I/O 和网络信息包速率高得多,都应进行进一步调查。
CPU
       These are percentages of total CPU time.(占总CPU时间的百分比)
       us: Time spent running non-kernel code. (user time, including nice time)(用户态占用CPU百分比)
  1. us 列显示了用户方式下所花费 CPU 时间的百分比。us的值比较高时,说明用户进程消耗的cpu时间多,但是如果长期大于50%,需要考虑优化用户的程序。
       sy: Time spent running kernel code. (system time)(内核态占用CPU百分比)
  1. sy 列显示了内核进程所花费的cpu时间的百分比。这里us + sy的参考值为80%,如果us+sy 大于 80%说明可能存在CPU不足。
       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.(IO等待占CPU百分比)
  1. wa 列显示了IO等待所占用的CPU时间的百分比。这里wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的,也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)。
       st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.(从一个虚拟机被盗的时间)(没明白)
 
(2)、DISK MODE
 
  1. # vmstat -d
  2. disk- ------------reads------------ ------------writes----------- -----IO------
  3. total merged sectors ms total merged sectors ms cur sec
  4. ram0 0 0 0 0 0 0 0 0 0 0
  5. ......
  6. ram15 0 0 0 0 0 0 0 0 0 0
  7. sda 86716 11900 2652279 209257 7464061 17760678 201798334 105591331 0 41193
  8. sr0 0 0 0 0 0 0 0 0 0 0
  9. md0 0 0 0 0 0 0 0 0 0 0
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(I/O进展)(没明白)
       s: seconds spent for I/O(I/O花费时间)
 
(3)、DISK PARTITION MODE
 
  1. # vmstat -p /dev/sda1
  2. sda1 reads    read sectors    writes    requested writes
  3. 957       1918           19         38
 reads: Total number of reads issued to this partition(对这个分区的read的总数)
 read sectors: Total read sectors for partition (该分区读取扇区总数)
 writes : Total number of writes issued to this partition(对这个分区的write的总数)
 requested writes: Total number of write requests made for partition(对该分区写请求的总数)
 
(4)、SLAB MODE
 
  1. # vmstat -m
  2. Cache Num Total Size Pages
  3. nfs_direct_cache 0 0 76 50
  4. nfs_write_data 36 42 512 7
  5. nfs_read_data 32 36 448 9
  6. nfs_inode_cache 7 12 668 6
  7. nfs_page 0 0 64 59
  8. fscache_cookie_jar 2 84 44 84
  9. rpc_buffers 8 8 2048 2
.....
Cache: Cache name(Cache 名字)
Num: Number of currently active objects(当前活动对象个数)
Total: Total number of available objects(可用对象总数)
Size:  Size of each object(每个对象的大小)
Pages: Number of pages with at least one active object(至少有一个活动对象的页数)
 
另外man page值还提到了totpages和pslab,在-m选项的结果中没有体现出来。
 
totpages: Total number of allocated pages( 分配的页面总数)
pslab: Number of pages per slab(每个slab 页面的数量)
 
2、Solaris下vmstat输出请参阅
 
3、AIX下vmstat输出请参阅
 
4、参考资料:

Linux性能分析 vmstat输出的更多相关文章

  1. Linux性能分析 vmstat基本语法

    vmstat      vmstat 统计虚拟内存信息,可以对操作系统的proc.memory.CPU.IO等信息进行统计以呈现给用户.   根据操作系统的不同,vmstat的输出结果会有不同.大家可 ...

  2. linux系统性能调优第一步——性能分析(vmstat)

    linux系统性能调优第一步--性能分析(vmstat) 分类: LINUX 性能调优的第一步是性能分析,下面从性能分析着手进行一些介绍,尤其对linux性能分析工具vmstat的用法和实践进行详细介 ...

  3. Linux 性能分析工具汇总合集

    出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望,因此整理了这篇文章.本文也可以作为检验基础知识的指标,另外文章涵盖了一个系统的方方面面.如果没有完善的计算机系统知识,网络知识和操作系统知识, ...

  4. Linux性能分析的前60000毫秒【转】

    Linux性能分析的前60000毫秒 为了解决性能问题,你登入了一台Linux服务器,在最开始的一分钟内需要查看什么? 在Netflix我们有一个庞大的EC2 Linux集群,还有非常多的性能分析工具 ...

  5. [转]Linux性能分析工具汇总合集

    出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望,因此整理了这篇文章.本文也可以作为检验基础知识的指标,另外文章涵盖了一个系统的方方面面.如果没有完善的计算机系统知识,网络知识和操作系统知识, ...

  6. 超全整理!Linux性能分析工具汇总合集

    转自:http://rdc.hundsun.com/portal/article/731.html?ref=myread 出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望,因此整理了这篇文章. ...

  7. (转)超全整理!Linux性能分析工具汇总合集

    超全整理!Linux性能分析工具汇总合集 原文:http://rdc.hundsun.com/portal/article/731.html 出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望, ...

  8. Linux性能分析命令工具汇总

    转自:http://rdc.hundsun.com/portal/article/731.html?ref=myread 出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望,因此整理了这篇文章. ...

  9. Linux 性能分析 工具命令

    背景知识:具备背景知识是分析性能问题时需要了解的.比如硬件 cache:再比如操作系统内核.应用程序的行为细节往往是和这些东西互相牵扯的,这些底层的东西会以意想不到的方式影响应用程序的性能,比如某些程 ...

随机推荐

  1. 使用MyEclipse开发Java EE应用:企业级应用程序项目(下)

    你开学,我放价!MyEclipse线上狂欢继续!火热开启中>> [MyEclipse最新版下载] 二.项目组织.依赖性和类解析 JEE规范为企业应用程序定义了一个分层的Java类解决策略, ...

  2. hibernate 各种主键生成策略(转)

    http://www.cnblogs.com/kakafra/archive/2012/09/16/2687569.html 1.assigned 主键由外部程序负责生成,在 save() 之前必须指 ...

  3. L226

    The dean can’t see you at the moment. He is addressing the first-year students in the lecture hall.系 ...

  4. require('nw.gui') 失效问题

    // gui = global.window.nwDispatcher.requireNwGui() --original // gui = window.require('nw.gui') gui ...

  5. IntelliJ IDEA使用(二):tomcat和jetty配置(转自:http://www.cnblogs.com/jenkinschan/p/6052948.html)

    上一讲用idea创建了maven web项目,接下来我们把项目发布到tomcat和jetty运行,以便进一步地开发和调试 配置tomcat 第一.打开菜单栏 第二.点击设置按钮,添加应用服务器,选择t ...

  6. 用于主题检测的临时日志(0ece3f5c-d74f-449c-85a7-ed53fffb0e94 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

    这是一个未删除的临时日志.请手动删除它.(abf5973f-502f-47e6-8825-4dd1c2cdd799 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

  7. 设计Popup Window

    设计一个Popup window, 在其中实现分享到Facebook 和Twitter 功能. popup window 名称为 ShareView.xaml, 代码如下: <phone:Pho ...

  8. magento开发中文手册

    Magento开发 第一章 手册简介Introduction 对一个开发人员来说,电子商务开发也许是现今最具创造性的工作.在这个瞬息万变的网络世界,为了保持始终领先竞争对手一步,无论是对你自己还是你的 ...

  9. win+linux双系统安装笔记

    1.出现win与linux只能引导之一启动,此时启动linux并更改启动文件可以用linux自带的grub2引导启动 2.ubuntu64位安装时需要联网,因为其有bug,镜像文件中缺少gurb2,需 ...

  10. Unity 3D游戏-消消乐(三消类)教程和源码

    Unity 消消乐教程和源码 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1 Start Game -- ...