Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2153361
  • 博文数量: 333
  • 博客积分: 10161
  • 博客等级: 上将
  • 技术积分: 5238
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-19 08:59
文章分类

全部博文(333)

文章存档

2017年(10)

2014年(2)

2013年(57)

2012年(64)

2011年(76)

2010年(84)

2009年(3)

2008年(37)

分类: LINUX

2012-11-15 15:07:17

Dstat: Versatile resource statistics tool
Dstat is a versatile replacement for vmstat, iostat, netstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.

Dstat allows you to view all of your system resources in real-time, you can eg. compare disk utilization in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).
Dstat gives you detailed selective information in columns and clearly indicates in what magnitude and unit the output is displayed. Less confusion, less mistakes. And most importantly, it makes it very easy to write plugins to collect your own counters and extend in ways you never expected.

Dstat's output by default is designed for being interpreted by humans in real-time, however you can export details to CSV output to a file to be imported later into Gnumeric or Excel to generate graphs.

  • Combines vmstat, iostat, ifstat, netstat information and more
  • Shows stats in exactly the same timeframe
  • Enable/order counters as they make most sense during analysis/troubleshooting
  • Modular design
  • Written in python so easily extendable for the task at hand
  • Easy to extend, add your own counters (please contribute those)
  • Includes many external plugins to show how easy it is to add counters
  • Can summarize grouped block/network devices and give total numbers
  • Can show interrupts per device
  • Very accurate timeframes, no timeshifts when system is stressed
  • Shows exact units and limits conversion mistakes
  • Indicate different units with different colors
  • Show intermediate results when delay > 1
  • Allows to export CSV output, which can be imported in Gnumeric and Excel to make graphs
Here are the existing plugins, send me your own plugins. 
[dag@moria ~]# dstat --list 

···略···

See the for options and a summary of each external plugin. 

  • Add /etc/dstat.conf configuration file to customize
  • Create a complete counter/object model structure
  • Interface directly with rrdtool for real-time graphing
  • Create client-server application model for remote graphing
  • See for more details
[dag@moria ~]$ dstat --help 
···略···

[dag@moria ~]# dstat 
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 
5 0 93 0 0 0| 154k 84k| 0 0 | 0 0 |1081 1116 13 0 87 0 0 0| 0 0 | 0 0 | 0 0 |1036 696 8 0 92 0 1 0| 0 8192B| 0 0 | 0 0 |1073 936 0 0 99 0 0 1| 0 0 | 0 0 | 0 0 |1072 940 1 1 97 0 2 0| 0 0 | 0 0 | 0 0 |1252 1727 1 1 98 0 1 0| 0 0 | 0 0 | 0 0 |1126 1191 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 |1045 908 0 0 99 0 0 0| 0 44k| 0 0 | 0 0 |1051 904 1 1 99 0 0 0| 0 0 | 0 0 | 0 0 |1036 850 1 0 100 0 0 0| 0 0 | 0 0 | 0 0 |1029 757
[dag@moria ~]$ dstat -c --top-cpu -d --top-bio --top-latency 
----total-cpu-usage---- -most-expensive- -dsk/total- ----most-expensive---- --highest-total-- usr sys idl wai hiq siq| cpu process | read writ| block i/o process | latency process 5 0 94 0 0 0|firefox 3.6| 148k 81k|init [5] 98k 50B|pdflush 21 2 1 98 0 0 0|wnck-applet 0.5| 0 0 | |at-spi-regist 5 2 1 98 0 0 0|firefox 0.5| 0 0 | |Xorg 1 1 2 97 0 0 1| | 0 0 | |Xorg 1 1 1 98 0 0 0| | 0 0 | |ksoftirqd/1 10 1 1 97 0 0 0|firefox 0.5| 0 0 | |ksoftirqd/0 5 2 1 97 0 0 0|firefox 0.5| 0 0 |firefox 0 28k|ksoftirqd/0 5 2 1 97 0 0 0|firefox 0.5| 0 0 | |Xorg 1 1 1 97 0 0 0|firefox 0.5| 0 0 | |ksoftirqd/0 6 2 1 98 0 0 0|firefox 0.5| 0 0 | |ksoftirqd/0 6 1 2 98 0 0 0| | 0 0 | |ksoftirqd/1 8 2 1 98 0 0 0|iwlagn 0.5| 0 72k|kjournald 0 32k|ksoftirqd/1 12 1 1 97 0 0 0| | 0 0 | |iwlagn/0 1 1 1 98 0 0 0|firefox 0.5| 0 0 | |ksoftirqd/1 8 

[root@monitor tool]# dstat -lasmt
—load-avg— —-total-cpu-usage—- -dsk/total- -net/total- —paging– —system– —-swap— ——memory-usage—– —–time—–
1m 5m 15m |usr sys idl wai hiq siq| read writ| recv send| in out | int csw | used free| used buff cach free| date/time
1.2 0.8 0.6| 10 3 86 0 0 0|3026B 3286k| 0 0 | 0 0 | 531 2275 | 132k 18G| 10G 232M 4625M 442M|22-03 11:01:43
1.2 0.8 0.6| 22 7 71 0 0 0| 0 0 | 39k 25k| 0 0 |1421 2913 | 132k 18G| 10G 232M 4626M 439M|22-03 11:01:44
1.1 0.8 0.6| 1 0 99 0 0 0| 0 0 | 86k 20k| 0 0 |1036 393 | 132k 18G| 10G 232M 4626M 468M|22-03 11:01:45
1.1 0.8 0.6| 0 0 99 0 0 0| 0 5704k|1288B 1796B| 0 0 |1175 418 | 132k 18G| 10G 232M 4626M 481M|22-03 11:01:46
Here are 2 screenshots of older dstat versions in action.

Dstat 0.4 on a Power5 system that is being stress tested.


Dsta 0.3 (first release) on 5 RHEL3 nodes in a cluster from a Windows terminal.
If you've found a bug, please check the for known problems and send me updates if you have more information to provide.

Please also copy&paste the output of the problem, with a description, the version of the kernel and if appropriate the involved /proc entries.

Dstat has a --debug option to profile plugins and show what plugins and /proc entries are affected. Dstat also shows some more information with the --version option that might be useful.
The following packages (in order of appearance) are available.
or grab the latest 0.7.2 tarball at:
There's a mailinglist about dstat and some other related tools at:
You can have access to the latest changes via subversion from:
The current asciidoc manual page is found here:
Subversion also holds the current documentation and example config-files, so please look there for more information. If you have improvements, found a bug or have a great idea, please mail me so we can look at how to integrate it.
I found some comments about dstat on blogs, here's what they say:
阅读(2126) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~