在一个xshell中执行dd命令:

 

time dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync

在另一个xshell中执行"iotop -tbo -d 1"以获得占用IO比较高的进程信息

 

[root@abc ~]# iotop -tbo -d 1
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 7.85 K/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:51 9399 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.02 % python /usr/sbin/iotop -tbo -d 1
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:52 9404 be/4 root 0.00 B/s 227.53 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 3.91 K/s | Total DISK WRITE: 265.58 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:53 496 be/4 root 3.91 K/s 117.22 K/s 0.00 % 5.36 % [flush-8:0]
13:52:53 9404 be/4 root 0.00 B/s 356.93 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:52:53 2018 be/4 highgo43 0.00 B/s 3.91 K/s 0.00 % 0.00 % postgres: stats collector process
Total DISK READ: 19.25 K/s | Total DISK WRITE: 858.54 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:54 9399 be/4 root 3.85 K/s 0.00 B/s 0.00 % 1.26 % python /usr/sbin/iotop -tbo -d 1
13:52:54 496 be/4 root 15.40 K/s 404.28 K/s 0.00 % 0.07 % [flush-8:0]
13:52:54 9404 be/4 root 0.00 B/s 831.85 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 65.89 K/s | Total DISK WRITE: 982.21 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:55 496 be/4 root 11.63 K/s 465.11 K/s 0.00 % 4.92 % [flush-8:0]
13:52:55 2015 be/4 highgo43 54.26 K/s 0.00 B/s 0.00 % 1.23 % postgres: writer process
13:52:55 9404 be/4 root 0.00 B/s 1029.74 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 0.00 B/s | Total DISK WRITE: 1030.27 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:56 554 be/3 root 0.00 B/s 235.36 M/s 0.00 % 0.28 % [jbd2/sda3-8]
13:52:56 496 be/4 root 0.00 B/s 476.68 K/s 0.00 % 0.18 % [flush-8:0]
13:52:56 9404 be/4 root 0.00 B/s 987.24 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 11.56 K/s | Total DISK WRITE: 1105.82 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:57 496 be/4 root 11.56 K/s 512.33 K/s 0.00 % 2.25 % [flush-8:0]
13:52:57 9404 be/4 root 0.00 B/s 1047.05 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 0.00 B/s | Total DISK WRITE: 974.74 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:58 9404 be/4 root 0.00 B/s 954.83 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:52:58 496 be/4 root 0.00 B/s 456.53 K/s 0.00 % 0.00 % [flush-8:0]
Total DISK READ: 27.10 K/s | Total DISK WRITE: 836.27 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:52:59 496 be/4 root 7.74 K/s 394.89 K/s 0.00 % 1.47 % [flush-8:0]
13:52:59 2048 be/4 highgo47 19.36 K/s 0.00 B/s 0.00 % 0.64 % postgres: writer process
13:52:59 9404 be/4 root 0.00 B/s 949.52 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 79.84 K/s | Total DISK WRITE: 1022.66 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:00 1498 be/3 root 79.84 K/s 0.00 B/s 0.00 % 3.70 % auditd
13:53:00 9404 be/4 root 0.00 B/s 1031.36 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:53:00 496 be/4 root 0.00 B/s 482.83 K/s 0.00 % 0.00 % [flush-8:0]
Total DISK READ: 34.18 K/s | Total DISK WRITE: 882.82 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:02 2063 be/4 root 22.79 K/s 0.00 B/s 0.00 % 0.56 % crond
13:53:02 496 be/4 root 11.39 K/s 417.77 K/s 0.00 % 0.55 % [flush-8:0]
13:53:02 554 be/3 root 0.00 B/s 304.06 M/s 0.00 % 0.34 % [jbd2/sda3-8]
13:53:02 9404 be/4 root 0.00 B/s 930.44 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 0.00 B/s | Total DISK WRITE: 979.58 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:03 496 be/4 root 0.00 B/s 455.98 K/s 0.00 % 1.31 % [flush-8:0]
13:53:03 9404 be/4 root 0.00 B/s 922.31 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 7.82 K/s | Total DISK WRITE: 1039.90 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:04 1956 be/4 root 7.82 K/s 0.00 B/s 0.00 % 1.15 % master
13:53:04 496 be/4 root 0.00 B/s 492.58 K/s 0.00 % 0.45 % [flush-8:0]
13:53:04 9404 be/4 root 0.00 B/s 1046.55 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 3.91 K/s | Total DISK WRITE: 1005.68 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:05 496 be/4 root 3.91 K/s 468.74 K/s 0.00 % 0.27 % [flush-8:0]
13:53:05 9404 be/4 root 0.00 B/s 1050.86 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 53.98 K/s | Total DISK WRITE: 858.12 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:06 2015 be/4 highgo43 53.98 K/s 0.00 B/s 0.00 % 1.58 % postgres: writer process
13:53:06 554 be/3 root 0.00 B/s 215.26 M/s 0.00 % 1.05 % [jbd2/sda3-8]
13:53:06 496 be/4 root 0.00 B/s 404.89 K/s 0.00 % 0.01 % [flush-8:0]
13:53:06 9404 be/4 root 0.00 B/s 831.01 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 7.79 K/s | Total DISK WRITE: 870.13 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:07 496 be/4 root 7.79 K/s 404.88 K/s 0.00 % 0.52 % [flush-8:0]
13:53:07 554 be/3 root 0.00 B/s 47.01 M/s 0.00 % 0.08 % [jbd2/sda3-8]
13:53:07 9404 be/4 root 0.00 B/s 891.80 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 105.29 K/s | Total DISK WRITE: 1000.53 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:08 2014 be/4 highgo43 105.29 K/s 0.00 B/s 0.00 % 0.03 % postgres: checkpointer process
13:53:08 9404 be/4 root 0.00 B/s 992.51 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:53:08 496 be/4 root 0.00 B/s 471.85 K/s 0.00 % 0.00 % [flush-8:0]
Total DISK READ: 7.80 K/s | Total DISK WRITE: 997.98 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:09 496 be/4 root 7.80 K/s 467.80 K/s 0.00 % 0.32 % [flush-8:0]
13:53:09 9404 be/4 root 0.00 B/s 1006.01 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 162.88 K/s | Total DISK WRITE: 981.66 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:10 496 be/4 root 0.00 B/s 457.61 K/s 0.00 % 6.50 % [flush-8:0]
13:53:10 2048 be/4 highgo47 19.39 K/s 0.00 B/s 0.00 % 2.67 % postgres: writer process
13:53:10 9404 be/4 root 0.00 B/s 1001.44 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:53:10 2047 be/4 highgo47 143.49 K/s 0.00 B/s 0.00 % 0.00 % postgres: checkpointer process
Total DISK READ: 92.21 K/s | Total DISK WRITE: 1088.62 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:11 554 be/3 root 0.00 B/s 291.99 M/s 0.00 % 5.69 % [jbd2/sda3-8]
13:53:11 2050 be/4 highgo47 65.32 K/s 0.00 B/s 0.00 % 4.00 % postgres: autovacuum launcher process
13:53:11 2045 be/4 highgo47 19.21 K/s 0.00 B/s 0.00 % 2.23 % postgres -D /home/highgo475/highgo/database/4.7.5/data
13:53:11 496 be/4 root 7.68 K/s 511.02 K/s 0.00 % 0.03 % [flush-8:0]
13:53:11 2051 be/4 highgo47 0.00 B/s 30.74 K/s 0.00 % 0.00 % postgres: stats collector process
13:53:11 9404 be/4 root 0.00 B/s 977.32 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 3.90 K/s | Total DISK WRITE: 984.85 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:12 496 be/4 root 3.90 K/s 459.72 K/s 0.00 % 1.05 % [flush-8:0]
13:53:12 9404 be/4 root 0.00 B/s 1036.08 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 0.00 B/s | Total DISK WRITE: 1043.94 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:13 496 be/4 root 0.00 B/s 488.74 K/s 0.00 % 0.18 % [flush-8:0]
13:53:13 9404 be/4 root 0.00 B/s 1005.66 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 97.14 K/s | Total DISK WRITE: 985.86 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:14 1584 be/4 rpc 93.25 K/s 0.00 B/s 0.00 % 2.38 % rpcbind
13:53:14 496 be/4 root 3.89 K/s 466.26 K/s 0.00 % 0.76 % [flush-8:0]
13:53:14 9404 be/4 root 0.00 B/s 1048.47 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 0.00 B/s | Total DISK WRITE: 1122.23 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:15 9404 be/4 root 0.00 B/s 1053.65 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
13:53:15 496 be/4 root 0.00 B/s 526.05 K/s 0.00 % 0.00 % [flush-8:0]
Total DISK READ: 294.06 K/s | Total DISK WRITE: 990.85 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:16 1745 be/4 haldaemo 212.80 K/s 0.00 B/s 0.00 % 1.63 % hald
13:53:16 2015 be/4 highgo43 54.17 K/s 0.00 B/s 0.00 % 0.70 % postgres: writer process
13:53:16 496 be/4 root 27.08 K/s 464.30 K/s 0.00 % 0.29 % [flush-8:0]
13:53:16 554 be/3 root 0.00 B/s 317.44 M/s 0.00 % 0.08 % [jbd2/sda3-8]
13:53:16 9404 be/4 root 0.00 B/s 1040.89 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 7.83 K/s | Total DISK WRITE: 986.50 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:17 496 be/4 root 7.83 K/s 461.75 K/s 0.00 % 3.32 % [flush-8:0]
13:53:17 9404 be/4 root 0.00 B/s 968.07 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 19.48 K/s | Total DISK WRITE: 902.15 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:18 496 be/4 root 19.48 K/s 420.72 K/s 0.00 % 0.46 % [flush-8:0]
13:53:18 9404 be/4 root 0.00 B/s 965.98 M/s 0.00 % 0.00 % dd if=/dev/zero of=test bs=100M count=256 conv=fdatasync
Total DISK READ: 15.57 K/s | Total DISK WRITE: 982.55 M/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:19 554 be/3 root 0.00 B/s 120.70 K/s 0.00 % 0.11 % [jbd2/sda3-8]
13:53:19 496 be/4 root 0.00 B/s 346.53 K/s 0.00 % 0.00 % [flush-8:0]
Total DISK READ: 82.24 K/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:20 1823 be/4 root 82.24 K/s 0.00 B/s 0.00 % 0.00 % automount --pid-file /var/run/autofs.pid
Total DISK READ: 27.44 K/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
13:53:21 1823 be/4 root 0.00 B/s 0.00 B/s 0.00 % 5.23 % automount --pid-file /var/run/autofs.pid
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
^C[root@abc ~]#

 

iotop命令的rpm包

 

[root@abc ~]# yum provides iotop
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
iotop-0.3.2-7.el6.noarch : Top like utility for I/O
Repo : rhel-source
Matched from:





iotop-0.3.2-7.el6.noarch : Top like utility for I/O
Repo : installed
Matched from:
Other : Provides-match: iotop