使用 dstat 工具可以查看 系统进程读写IO,这对于不能装 iotop的人来说是一个福音。redhat/centos 5 系统自带dstat 工具

查看帮助:
dstat  --help
Usage: dstat [-afv] [options..] [delay [count]]
Versatile tool for generating system resource statistics

Dstat options:
  -c, --cpu              enable cpu stats
     -C 0,3,total           include cpu0, cpu3 and total
  -d, --disk             enable disk stats
     -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              enable memory stats
  -n, --net              enable network stats
     -N eth1,total          include eth1 and total
  -p, --proc             enable process stats
  -s, --swap             enable swap stats
     -S swap1,total         include swap1 and total
  -t, --time             enable time/date output
  -T, --epoch            enable time counter (seconds since epoch)
  -y, --sys              enable system stats
  --ipc                  enable ipc stats
  --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              equals -cdngy (default)
  -f, --full             expand -C, -D, -I, -N and -S discovery lists
  -v, --vmstat           equals -pmgdsc -D total

  --integer              show integer values
  --nocolor              disable colors (implies --noupdate)
  --noheaders            disable repetitive headers
  --noupdate             disable intermediate updates
  --output file          write CSV output to file

  delay is the delay in seconds between each update
  count is the number of updates to display before exiting
  The default delay is 1 and count is unspecified (unlimited)

dstat -M list
/usr/share/dstat:
        battery, cpufreq, dbus, freespace, gpfs, gpfsop, helloworld, innodb_buffer, innodb_io, innodb_ops, mysql5_com, mysql5_conn, mysql5_io, mysql5_keys, mysql_io, mysql_keys, nfs3, nfs3op, nfsd3, nfsd3op, postfix, rpc, rpcd, sendmail, thermal, topbio, topcpu, topio, topmem, topoom, utmp, vmkhba, vmkint, vmknic, vzcpu, vzubc, wifi,

 dstat -M topio  -M topbio 
----most-expensive---- ----most-expensive----
     i/o process      |  block i/o process  
mysqld       16M: 140k|mysqld      926B: 109k
syslogd     413B:1460B|syslogd       0 :  44k
squid      3340B: 173k|syslogd       0 : 184k
squid        22k: 406k|syslogd       0 : 104k
squid       334B:  47k|syslogd       0 : 132k
squid      2792B: 163k|syslogd       0 :  60k
squid        25k: 239k|syslogd       0 : 216k

dstat -M topio  -M topbio -d
----most-expensive---- ----most-expensive---- -dsk/total-
     i/o process      |  block i/o process   | read  writ
mysqld       16M: 140k|mysqld      925B: 109k|7817B  742k
squid-graph   0 :4512k|syslogd       0 : 148k|   0  1400k
crond        12M:6264k|syslogd       0 :  92k|   0   920k
squid       329k: 370k|syslogd       0 : 400k|   0  3312k
squid        23k:  33k|syslogd       0 : 128k|   0  1040k
squid      3980B: 373k|syslogd       0 : 160k|   0  1304k
mysqld     3611k: 529k|mysqld        0 : 444k|   0  3672k

磁盘IO 监控:
dstat -D /dev/sda1,/dev/sda2 ....

呵呵,看起来很好玩