|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
1) 工具说明
1 o, L6 h/ a3 [0 l1 u( d# z
, p3 |9 U- K: q' ] c" O% Rdstat是一个用来替换 vmstat,iostat netstat,nfsstat和ifstat这些命令的工具, 是一个全能系统信息统计工具. 与sysstat相比, dstat拥有一个彩色的界面, 在手动观察性能状况时, 数据比较显眼容易观察; 而且dstat支持即时刷新, 譬如输入dstat 3, 即每三秒收集一次, 但最新的数据都会每秒刷新显示. 和sysstat相同的是, dstat也可以收集指定的性能资源, 譬如 dstat -c 即显示CPU的使用情况.
, s' y1 c; d l* D4 @, C下载安装文件dstat-0.6.7-1.el*.RF.noarch.rpm: http://dag.wieers.com/rpm/packages/dstat/8 k6 u! `3 S* |6 a& m0 t
: Y6 D0 B( m% D; {; M2) 软件安装
. q& D) f4 g+ m( w- I+ ]" n- U% W# f3 y2 y, ?: Y( g
# cd /tmp. Q) i$ S' R/ u0 w; u9 I$ Z
# rz (上传安装包)" m( b' r' j0 ?
# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm
/ G: t6 E5 Z! Q8 w$ z# @! g# which dstat! X K: S( a" R h6 \8 g1 N+ {
/usr/bin/dstat5 J2 \3 m+ K( T8 P* q; ]: F+ S
8 Z9 i1 ]* a( a5 \3) 使用示例7 C0 S6 _( K, ]# M& E1 r
; d; }- i E* y8 X1 h7 y) z# dstat2 y0 w/ }0 X5 k/ a5 E
安装完成后, 执行 dstat 命令, 默认情况它会收集-cpu-,-disk-,-net-,-paging-,-system-的数据, 一秒钟收集一次. 默认输入dstat等于输入了dstat -cdngy 1或dstat -a 1. 推荐使用 date && dstat -tclmdny 60 一分钟监视一次(注意调节显示的宽度, 或去掉-t选项).
! H+ [2 y, Z1 [
% E& u9 L' l8 `. Y5 S4) dstat 选项
9 p4 n: e, @8 \, G [1 x. |* x: i S0 \1 m* \% `# z+ {% X& d
-c, -cpu 显示CPU情况. z1 S% `5 R2 p# T; S) Z' X
-C 0,3,total include cpu0, cpu3 and total! a- n, Q& q. m5 R* G7 i- {
-d, -disk 显示磁盘情况3 Y. z, i8 A1 E7 q# u! s
-D total,hda include hda and total6 n$ x1 {: l0 K7 p
-g, -page enable page stats
1 C' w* R2 r5 w3 j( d* s. p+ g-i, -int enable interrupt stats: A& _ W6 b( o/ t
-I 5,eth2 include int5 and interrupt used by eth2- C9 ?$ @: M; s: u4 F: |
-l, -load enable load stats
; q k5 i# B6 o* o! J2 b-m, -mem 显示内存情况/ M$ g$ B! l" B# Z. A" h
-n, -net 显示网络情况% f; k" V+ ]; f* l# O
-N eth1,total 可以指定网络接口
" G6 {- x9 j$ \* `2 e* X-p, -proc enable process stats
" ?2 W/ t, q! `2 M" @% w-s, -swap 显示swap情况: h3 `+ D! u8 ]4 |) }
-S swap1,total 可以指定多个swap+ x, R) T7 b4 v. v0 d$ q4 D
-t, -time enable time counter( Q1 }% v! }9 ?) `; c. Q, {
-y, -sys enable system stats+ q( B, d) _- S& ~- i- K+ T: Q
-ipc 报告IPC消息队列和信号量的使用情况
; Z K7 c: B4 v+ A8 F" i- D-lock enable lock stats& Y) [9 P$ N2 N7 P* h# i
-raw enable raw stats
& g# k G! f( ]* J; p) M: w-tcp enable tcp stats9 a2 q/ U. _' [) U, E8 V
-udp enable udp stats
5 k* T' q2 @1 X8 d-unix enable unix stats
6 q' B, F4 f6 B. H2 n0 W-M stat1,stat2 enable external stats2 D" g2 ?! `2 Z6 X h4 W0 \7 C6 ~
-mods stat1,stat2/ D& \+ W+ p' S/ G, H8 [$ i
-a, -all 使用-cdngy 缺省的就是这样显示# w+ G1 k4 \' q- b9 f
-f, -full 使用 -C, -D, -I, -N and -S 显示. ^( f" e! r) t( ?; D; c$ |
-v, -vmstat 使用-pmgdsc -D 显示& ~, C; W7 i# t" t/ l
-integer show integer values4 F" Q2 Y" l6 V* o( T2 o& @) a; N
-nocolor disable colors (implies -noupdate)8 P# d0 y9 c" D
-noheaders 只显示一次表头以后就不显示了,使用重定向写入文件时很有用
9 J( z+ [5 U+ F' |$ ~+ ~& _-noupdate disable intermediate updates; y' W t# E9 @/ }
-output file 写入到CVS文件中
; M& A2 G* | e+ o这个软件和vmstat很像, 不过和vmstat相比好像少了io部份的显示, dstat只能显示磁盘的吞吐量而不是显示负载情况, dstat和几乎所有监控软件一样, 只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析. 我常使用的参数是dstat -cdlmnpsy, 做个别名链接alias dstat='dstat -cdlmnpsy'7 K0 N' \! Q* l2 ~ [' w/ M: O- ~
|
|