Linux性能分析 vmstat基本语法
vmstat
- kthr memory page faults cpu
- procs memory page disk faults cpu
- procs memory swap io system cpu
- # uname -a
- Linux test02 2.6.18-92.el5PAE #1 SMP Tue Jun 10 19:22:41 EDT 2008 i686 i686 i386 GNU/Linux
- # which vmstat
- /usr/bin/vmstat
- # rpm -qf /usr/bin/vmstat
- procps-3.2.7-9.el5
- vmstat [-a] [-n] [delay [ count]]
- vmstat [-f] [-s] [-m]
- vmstat [-S unit]
- vmstat [-d]
- vmstat [-p disk_partition]
- vmstat [-V]
- # vmstat
- 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 0 15173344 159684 1025204 0 0 0 2 1 1 0 0 100 0 0
[-a]显示 活动(active)和 非活动(inactive)的内存。
- # vmstat -a
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free inact active si so bi bo in cs us sy id wa st
- 0 0 0 15173344 257432 1125300 0 0 0 2 1 1 0 0 100 0 0
[ -n ]只显示头信息,不周期性显示。这里没有测试出-n的作用,貌似有和没有,结果都一样。[ -f ]显示自开机以来forks的总数,包括fork、vfork和clone system calls,总数和tasks创建的数量是一致的。
- # vmstat -f
- 662900 forks
- # vmstat -f
- 662901 forks
- # vmstat -f
- 662902 forks
- # vmstat -f
- 662903 forks
[ -s ]显示各种事件计数器表和内存统计信息,这显示不重复。
- # vmstat -s
- 16621896 total memory
- 1450164 used memory
- 1126060 active memory
- 257436 inactive memory
- 15171732 free memory
- 159696 buffer memory
- 1025228 swap cache
- 10241428 total swap
- 0 used swap
- 10241428 free swap
- 407585 non-nice user cpu ticks
- 99282 nice user cpu ticks
- 507104 system cpu ticks
- 4025968737 idle cpu ticks
- 3367298 IO-wait cpu ticks
- 179918 IRQ cpu ticks
- 70168 softirq cpu ticks
- 0 stolen cpu ticks
- 1279463 pages paged in
- 99068439 pages paged out
- 0 pages swapped in
- 0 pages swapped out
- 840368546 interrupts
- 505464033 CPU context switches
- 1296116054 boot time
- 662891 forks
[ -m ]显示slabinfo,好像是缓存相关的,对这个完全不懂。可以对比一下/proc/slabinfo的内容。内容过多,就不粘贴过来了。
[-V]显示版本信息。
- # vmstat -V
- procps version 3.2.7
[ -d ]显示磁盘数据(disk statistics)
- # vmstat -d
- disk- ------------reads------------ ------------writes----------- -----IO------
- total merged sectors ms total merged sectors ms cur sec
- ram0 0 0 0 0 0 0 0 0 0 0
- ram1 0 0 0 0 0 0 0 0 0 0
- ram2 0 0 0 0 0 0 0 0 0 0
- ram3 0 0 0 0 0 0 0 0 0 0
- ram4 0 0 0 0 0 0 0 0 0 0
- ram5 0 0 0 0 0 0 0 0 0 0
- ram6 0 0 0 0 0 0 0 0 0 0
- ram7 0 0 0 0 0 0 0 0 0 0
- ram8 0 0 0 0 0 0 0 0 0 0
- ram9 0 0 0 0 0 0 0 0 0 0
- ram10 0 0 0 0 0 0 0 0 0 0
- ram11 0 0 0 0 0 0 0 0 0 0
- ram12 0 0 0 0 0 0 0 0 0 0
- ram13 0 0 0 0 0 0 0 0 0 0
- ram14 0 0 0 0 0 0 0 0 0 0
- ram15 0 0 0 0 0 0 0 0 0 0
- sda 78933 11718 2558111 196860 7323094 17437763 198087270 103643068 0 40409
- sr0 0 0 0 0 0 0 0 0 0 0
- md0 0 0 0 0 0 0 0 0 0 0
[ -D ]显示磁盘统计表(disk table)
- # vmstat -D
- 19 disks
- 3 partitions
- 78933 total reads
- 11718 merged reads
- 2558111 read sectors
- 196860 milli reading
- 7323091 writes
- 17437754 merged writes
- 198087174 written sectors
- 103643051 milli writing
- 0 inprogress IO
- 40409 milli spent IO
[ -S 单位 ]k:1000K:1024 (默认为K)m:1000000M:1048576比较:k和K
- # vmstat -S k
- 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 0 15536107 163528 1049833 0 0 0 2 1 1 0 0 100 0 0
- # vmstat -S K
- 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 0 15173840 159696 1025228 0 0 0 2 1 1 0 0 100 0 0
[ -p 分区 ]显示磁盘分区数据(disk partition statistics )
- # vmstat -p /dev/sda1
- sda1 reads read sectors writes requested writes
- 957 1918 19 38
- # vmstat -p /dev/sda2
- sda2 reads read sectors writes requested writes
- 88375 2554274 24766385 198131080
- # vmstat -p /dev/sda3
- sda3 reads read sectors writes requested writes
- 1268 1439 0 0
[ delay [ count ] ]delay是间隔,count显示多少次信息。可以和上面的某些参数结合使用。
- # vmstat 1 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 0 15171484 159696 1025228 0 0 0 2 1 1 0 0 100 0 0
- 1 0 0 15171484 159696 1025228 0 0 0 0 1013 77 0 0 100 0 0
- 0 0 0 15171484 159696 1025228 0 0 0 48 1038 194 0 0 100 0 0
- # vmstat 2 4
- 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 0 15173344 159696 1025228 0 0 0 2 1 1 0 0 100 0 0
- 0 0 0 15173344 159696 1025228 0 0 0 52 1037 116 0 0 100 0 0
- 0 0 0 15173344 159696 1025228 0 0 0 0 1027 109 0 0 100 0 0
- 0 0 0 15171484 159696 1025228 0 0 0 32 1023 131 0 0 100 0 0
vmstat 1 3 是每1秒显示一次,共显示3次vmstat 2 4 是每2秒显示一次,共显示4次
Linux性能分析 vmstat基本语法的更多相关文章
- Linux性能分析 vmstat输出
vmstat输出 1.linux系统下vmstat输出 vmstat的输出分为以下几种模式: (1).VM MODE (普通选项) (2).DISK MODE(-d选项) (3).DI ...
- linux系统性能调优第一步——性能分析(vmstat)
linux系统性能调优第一步--性能分析(vmstat) 分类: LINUX 性能调优的第一步是性能分析,下面从性能分析着手进行一些介绍,尤其对linux性能分析工具vmstat的用法和实践进行详细介 ...
- 【转】一文掌握 Linux 性能分析之 I/O 篇
[转]一文掌握 Linux 性能分析之 I/O 篇 这是 Linux 性能分析系列的第三篇,前两篇分别讲了 CPU 和 内存,本篇来看 IO. IO 和 存储密切相关,存储可以概括为磁盘,内存,缓存, ...
- 【转】一文掌握 Linux 性能分析之内存篇
[转]一文掌握 Linux 性能分析之内存篇 前面我们已经学习了 CPU 篇,这篇来看下内存篇. 01 内存信息 同样在分析内存之前,我们得知到怎么查看系统内存信息,有以下几种方法. 1.1 /pro ...
- 【转】一文掌握 Linux 性能分析之 CPU 篇
[转]一文掌握 Linux 性能分析之 CPU 篇 平常工作会涉及到一些 Linux 性能分析的问题,因此决定总结一下常用的一些性能分析手段,仅供参考. 说到性能分析,基本上就是 CPU.内存.磁盘 ...
- 【原创】一文掌握 Linux 性能分析之 I/O 篇
本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. 一文掌握 Li ...
- 一文掌握 Linux 性能分析之 CPU 篇
本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. 平常工作会涉及 ...
- Linux 性能分析工具汇总合集
出于对Linux操作系统的兴趣,以及对底层知识的强烈欲望,因此整理了这篇文章.本文也可以作为检验基础知识的指标,另外文章涵盖了一个系统的方方面面.如果没有完善的计算机系统知识,网络知识和操作系统知识, ...
- Linux性能分析的前60000毫秒【转】
Linux性能分析的前60000毫秒 为了解决性能问题,你登入了一台Linux服务器,在最开始的一分钟内需要查看什么? 在Netflix我们有一个庞大的EC2 Linux集群,还有非常多的性能分析工具 ...
随机推荐
- 踢掉某个li
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Ubuntu使用Remastersys封装制作系统ISO镜像
首先下载Remastersys的Deb软件包 链接:http://pan.baidu.com/s/1i3tYPKT 密码:qvyd 使用命令强制安装 dpkg --force-all -i remas ...
- 表单提交时编码类型enctype详解
很早以前,当还没有前端这个概念的时候,我在写表单提交完全不去理会表单数据的编码,在action属性里写好目标URL,剩下的啊交给浏览器吧~但是现在,更多时候我们都采用Ajax方式提交数据,这种原始的方 ...
- HDU 1501 Zipper(DFS)
Problem Description Given three strings, you are to determine whether the third string can be formed ...
- 详解基本TCP套接字函数
以下讲解基本TCP套接字函数. 1.socket 函数 指定期望的通信协议类型. #include <sys/types.h> /* See NOTES */ #include ...
- how to check CAN frame
1. check buffer size getsockopt(s, SOL_SOCKET, SO_SNDBUF,&snd_size, &optlen); setsockopt(s, ...
- IplImage 与mat之间的转换及释放内存
IplImage *x = cvLoadImage(savefilename, ); Mat img(x,true); cvReleaseImage(&x); 完
- BZOJ5091: [Lydsy1711月赛]摘苹果【期望DP】
Description 小Q的工作是采摘花园里的苹果.在花园中有n棵苹果树以及m条双向道路,苹果树编号依次为1到n,每条道路的两 端连接着两棵不同的苹果树.假设第i棵苹果树连接着d_i条道路.小Q将会 ...
- mysql 常用linux命令
★ 数据导出命令 D:\Program Files\MySQL\MySQL Server 5.6.39\bin 导出: mysqldump -u root -p cela_sub > D:/d ...
- Html页面Dom对象之Document
Document 对象 每个载入浏览器的 HTML 文档都会成为 Document 对象. Document 对象使我们可以从脚本中对 HTML 页面中的所有元素进行访问. 提示:Document 对 ...