免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2137 | 回复: 0
打印 上一主题 下一主题

linux 性能检测工具之 dstat [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-09-21 20:56 |只看该作者 |倒序浏览
linux 性能检测工具之 dstat



这几天在做lamp性能调优,对系统性能检测使用top vmstat 发现非常不妨便,在刚开会的时候, @mandahang 介绍了一个软件 dstat,用起来感觉还真不错。下面则对dstat 做下简单的介绍:
一、安装
1.在centos下 可以 yum -y instatll dstat
2. 下载rpm包进行安装
wget http://packages.sw.be/dstat/dstat-0.7.2-1.el5.rfx.noarch.rpm
rpm -ivh dstat-0.7.2-1.el5.rfx.noarch.rpm
二、使用
1.执行 dstat 命令的时候,默认他会 收集-cpu-、-disk-、-net-、-paging-、-system-的数据,一秒钟收集一次。默认输入 dstat 等于输入了dstat -cdngy 1或dstat -a 1;


如果我们执行 dstat 3 命令的话,他就是3秒收集一次信息。
2.同样的 dstat 也可以收集指定的性能资源。使用 dstat -h 可以看到相应的参数。
  Dstat options:
  -c, --cpu              显示CPU情况
  -C 0,3,total           include cpu0, cpu3 and total
  -d, --disk             显示磁盘情况
  -D total,hda           include hda and total
  -g, --page             enable page stats
  -i, --int              enable interrupt stats
  -I 5,eth2              include int5 and interrupt used by eth2
  -l, --load             enable load stats
  -m, --mem              显示内存情况
  -n, --net              显示网络情况
  -N eth1,total          可以指定网络接口
  -p, --proc             enable process stats
  -s, --swap             显示swap情况
  -S swap1,total         可以指定多个swap
  -t, --time             enable time counter
  -y, --sys              enable system stats
  --ipc                  报告IPC消息队列和信号量的使用情况
  --lock                 enable lock stats
  --raw                  enable raw stats
  --tcp                  enable tcp stats
  --udp                  enable udp stats
  --unix                 enable unix stats
  -M stat1,stat2         enable external stats
  --mods stat1,stat2
  -a, --all              使用-cdngy 缺省的就是这样显示
  -f, --full             使用 -C, -D, -I, -N and -S 显示
  -v, --vmstat           使用-pmgdsc -D 显示
  --integer              show integer values
  --nocolor              disable colors (implies --noupdate)
  --noheaders            只显示一次表头以后就不显示了,使用重定向写入文件时很有用
  --noupdate             disable intermediate updates
  --output file          写入到CVS文件中
  dstat -cdlmnpsy
  在1024×768的屏幕上正好全部显示出来
  别名  alias dstat='dstat -cdlmnpsy'
例 图:

我们选择 cdlmnpsyt 几个参数 让它5秒刷新一次
他会针对 cpu 磁盘 load 内存 网络 process swap 时间 等具体资源,进行抓取信息。也许是由于以前不知道,新鲜感吧,今天用这个工具感觉还是听不错的。
   知道的朋友们就当看个热闹,没用过的,可以试一试,嘿嘿,真的还不错。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP