|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
1) 工具说明
# H' [5 L( Q9 @; n3 l3 T4 ^$ z; K7 T" Z+ k+ ]/ d& m) W# s
dstat是一个用来替换 vmstat,iostat netstat,nfsstat和ifstat这些命令的工具, 是一个全能系统信息统计工具. 与sysstat相比, dstat拥有一个彩色的界面, 在手动观察性能状况时, 数据比较显眼容易观察; 而且dstat支持即时刷新, 譬如输入dstat 3, 即每三秒收集一次, 但最新的数据都会每秒刷新显示. 和sysstat相同的是, dstat也可以收集指定的性能资源, 譬如 dstat -c 即显示CPU的使用情况.
% R) X/ @. B5 C1 c( P下载安装文件dstat-0.6.7-1.el*.RF.noarch.rpm: http://dag.wieers.com/rpm/packages/dstat/0 A. Z1 G+ w$ v B; l C1 n) J, @. i
& d2 _# T0 A; a$ C6 l, S( n) q7 O* n
2) 软件安装/ T6 ]7 R6 `6 k$ F( ?0 [
6 L8 r V, H; }2 w
# cd /tmp; p Y3 M/ U7 q
# rz (上传安装包)
( t. p0 s% f* S% K' q/ ]6 D2 j3 \# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm5 L& j- r& ?: g5 Y% `: X% Z6 M$ z
# which dstat! q, b# _# k! g7 r: k
/usr/bin/dstat8 @: w0 f( w1 w9 z! A- H7 C
9 \+ G/ Q5 H) c9 q3) 使用示例. O0 Z' _3 ^3 H! L
* }! T1 C. W6 N+ D" R2 z2 [5 f$ j X# dstat
, T( l5 M) e& Z- M4 J安装完成后, 执行 dstat 命令, 默认情况它会收集-cpu-,-disk-,-net-,-paging-,-system-的数据, 一秒钟收集一次. 默认输入dstat等于输入了dstat -cdngy 1或dstat -a 1. 推荐使用 date && dstat -tclmdny 60 一分钟监视一次(注意调节显示的宽度, 或去掉-t选项).
% k; j$ V( ?/ \/ a2 N. {: j0 \; m$ e: j& l; o$ |
4) dstat 选项
1 V% c0 y- K0 J; L* m( y' B/ U2 s7 I$ R3 f
-c, -cpu 显示CPU情况
2 d: Z$ r& @0 X4 h' w$ C-C 0,3,total include cpu0, cpu3 and total
; o* P- z! y, D' I-d, -disk 显示磁盘情况
8 j1 R- R: ?5 K: u0 S-D total,hda include hda and total
3 M/ E! x/ B: G& J-g, -page enable page stats- l! u0 @# p7 v4 i3 D2 f2 V
-i, -int enable interrupt stats! O+ J- n0 S* \7 `& D- Y; U. r
-I 5,eth2 include int5 and interrupt used by eth2( L& m+ a R; ?: x" s* b8 [
-l, -load enable load stats! f& L6 D1 w6 P" _) m
-m, -mem 显示内存情况
& b$ z6 K4 }# P) |' g-n, -net 显示网络情况2 N4 s9 H8 n5 `) s
-N eth1,total 可以指定网络接口
) ~! {% c3 L* \# n7 C-p, -proc enable process stats
$ }/ |7 t" t* `. J3 O-s, -swap 显示swap情况
$ @; P+ z! i2 h5 U# S8 p-S swap1,total 可以指定多个swap
. d9 x: [2 Z$ P8 X& V" S5 A2 m-t, -time enable time counter9 f1 H$ p# i6 a/ A2 q
-y, -sys enable system stats$ V( S: E6 M& A! S' ?3 _ u
-ipc 报告IPC消息队列和信号量的使用情况
( S ]* |* w% [8 O9 R& N-lock enable lock stats4 F+ F8 V- Y* c( P( ^
-raw enable raw stats. X3 v% n: R4 M5 I5 ]3 y4 M% }
-tcp enable tcp stats0 P" h; R3 c% f' B
-udp enable udp stats3 g i8 m3 A% ^9 \
-unix enable unix stats
/ N+ Z: V$ I3 F+ M; r! n X-M stat1,stat2 enable external stats& S7 n" G7 g/ P' ]
-mods stat1,stat23 B0 Y' @7 e$ [( n+ x$ S7 Y0 R
-a, -all 使用-cdngy 缺省的就是这样显示# \9 T) y K5 d. m) P
-f, -full 使用 -C, -D, -I, -N and -S 显示- |; Y) p5 Q7 t% S+ s
-v, -vmstat 使用-pmgdsc -D 显示
, W2 y3 P7 {" G8 E0 }# A6 w-integer show integer values' g$ ~6 e2 K2 n- t! w& m
-nocolor disable colors (implies -noupdate)
. R" H |+ ^! Q0 f* O5 n0 T-noheaders 只显示一次表头以后就不显示了,使用重定向写入文件时很有用
& Q# L' F1 J1 m+ u0 p8 e8 o2 ^-noupdate disable intermediate updates! E& P' ]3 b& u3 v, `
-output file 写入到CVS文件中
0 A6 k' q) \- z这个软件和vmstat很像, 不过和vmstat相比好像少了io部份的显示, dstat只能显示磁盘的吞吐量而不是显示负载情况, dstat和几乎所有监控软件一样, 只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析. 我常使用的参数是dstat -cdlmnpsy, 做个别名链接alias dstat='dstat -cdlmnpsy' `# R& S% h0 S4 _8 O8 M. D* F
|
|