1 1.1 christos The following are demonstrations of the iotop program, 2 1.1 christos 3 1.1 christos 4 1.1 christos Here we run iotop with the -C option to not clear the screen, but instead 5 1.1 christos provide a scrolling output, 6 1.1 christos 7 1.1 christos # iotop -C 8 1.1 christos Tracing... Please wait. 9 1.1 christos 2005 Jul 16 00:34:40, load: 1.21, disk_r: 12891 KB, disk_w: 1087 KB 10 1.1 christos 11 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D BYTES 12 1.1 christos 0 3 0 fsflush cmdk0 102 4 W 512 13 1.1 christos 0 3 0 fsflush cmdk0 102 0 W 11776 14 1.1 christos 0 27751 20320 tar cmdk0 102 16 W 23040 15 1.1 christos 0 3 0 fsflush cmdk0 102 0 R 73728 16 1.1 christos 0 0 0 sched cmdk0 102 0 R 548864 17 1.1 christos 0 0 0 sched cmdk0 102 0 W 1078272 18 1.1 christos 0 27751 20320 tar cmdk0 102 16 R 1514496 19 1.1 christos 0 27751 20320 tar cmdk0 102 3 R 11767808 20 1.1 christos 21 1.1 christos 2005 Jul 16 00:34:45, load: 1.23, disk_r: 83849 KB, disk_w: 488 KB 22 1.1 christos 23 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D BYTES 24 1.1 christos 0 0 0 sched cmdk0 102 4 W 1536 25 1.1 christos 0 0 0 sched cmdk0 102 0 R 131072 26 1.1 christos 0 27752 20320 find cmdk0 102 0 R 262144 27 1.1 christos 0 0 0 sched cmdk0 102 0 W 498176 28 1.1 christos 0 27751 20320 tar cmdk0 102 3 R 11780096 29 1.1 christos 0 27751 20320 tar cmdk0 102 5 R 29745152 30 1.1 christos 0 27751 20320 tar cmdk0 102 4 R 47203328 31 1.1 christos 32 1.1 christos 2005 Jul 16 00:34:50, load: 1.25, disk_r: 22394 KB, disk_w: 2 KB 33 1.1 christos 34 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D BYTES 35 1.1 christos 0 27752 20320 find cmdk0 102 0 W 2048 36 1.1 christos 0 0 0 sched cmdk0 102 0 R 16384 37 1.1 christos 0 321 1 automountd cmdk0 102 0 R 22528 38 1.1 christos 0 27752 20320 find cmdk0 102 0 R 1462272 39 1.1 christos 0 27751 20320 tar cmdk0 102 5 R 17465344 40 1.1 christos 41 1.1 christos In the above output, we can see a tar command is reading from the cmdk0 42 1.1 christos disk, from several different slices (different minor numbers), on the last 43 1.1 christos report focusing on 102,5 (an "ls -lL" in /dev/dsk can explain the number to 44 1.1 christos slice mappings). 45 1.1 christos 46 1.1 christos The disk_r and disk_w values give a summary of the overall activity in 47 1.1 christos bytes. 48 1.1 christos 49 1.1 christos 50 1.1 christos 51 1.1 christos Bytes can be used as a yardstick to determine which process is keeping the 52 1.1 christos disks busy, however either of the delta times available from iotop would 53 1.1 christos be more accurate (as they take into account whether the activity is random 54 1.1 christos or sequential). 55 1.1 christos 56 1.1 christos # iotop -Co 57 1.1 christos Tracing... Please wait. 58 1.1 christos 2005 Jul 16 00:39:03, load: 1.10, disk_r: 5302 KB, disk_w: 20 KB 59 1.1 christos 60 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D DISKTIME 61 1.1 christos 0 0 0 sched cmdk0 102 0 W 532 62 1.1 christos 0 0 0 sched cmdk0 102 0 R 245398 63 1.1 christos 0 27758 20320 find cmdk0 102 0 R 3094794 64 1.1 christos 65 1.1 christos 2005 Jul 16 00:39:08, load: 1.14, disk_r: 5268 KB, disk_w: 273 KB 66 1.1 christos 67 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D DISKTIME 68 1.1 christos 0 3 0 fsflush cmdk0 102 0 W 2834 69 1.1 christos 0 0 0 sched cmdk0 102 0 W 263527 70 1.1 christos 0 0 0 sched cmdk0 102 0 R 285015 71 1.1 christos 0 3 0 fsflush cmdk0 102 0 R 519187 72 1.1 christos 0 27758 20320 find cmdk0 102 0 R 2429232 73 1.1 christos 74 1.1 christos 2005 Jul 16 00:39:13, load: 1.16, disk_r: 602 KB, disk_w: 1238 KB 75 1.1 christos 76 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D DISKTIME 77 1.1 christos 0 3 0 fsflush cmdk0 102 4 W 200 78 1.1 christos 0 3 0 fsflush cmdk0 102 6 W 260 79 1.1 christos 0 3 0 fsflush cmdk0 102 0 W 883 80 1.1 christos 0 27758 20320 find cmdk0 102 0 R 55686 81 1.1 christos 0 3 0 fsflush cmdk0 102 0 R 317508 82 1.1 christos 0 0 0 sched cmdk0 102 0 R 320195 83 1.1 christos 0 0 0 sched cmdk0 102 0 W 571084 84 1.1 christos [...] 85 1.1 christos 86 1.1 christos The disk time is in microseconds. In the first sample, we can see the find 87 1.1 christos command caused a total of 3.094 seconds of disk time - the duration of the 88 1.1 christos samples here is 5 seconds (the default), so it would be fair to say that 89 1.1 christos the find command is keeping the disk 60% busy. 90 1.1 christos 91 1.1 christos 92 1.1 christos 93 1.1 christos A new option for iotop is to print percents "-P" which are based on disk 94 1.1 christos I/O times, and hense are a fair measurementt of what is keeping the disks 95 1.1 christos busy. 96 1.1 christos 97 1.1 christos # iotop -PC 1 98 1.1 christos Tracing... Please wait. 99 1.1 christos 2005 Nov 18 15:26:14, load: 0.24, disk_r: 13176 KB, disk_w: 0 KB 100 1.1 christos 101 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 102 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 85 103 1.1 christos 104 1.1 christos 2005 Nov 18 15:26:15, load: 0.25, disk_r: 5263 KB, disk_w: 0 KB 105 1.1 christos 106 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 107 1.1 christos 0 2214 1663 find cmdk0 102 0 R 15 108 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 67 109 1.1 christos 110 1.1 christos 2005 Nov 18 15:26:16, load: 0.25, disk_r: 8724 KB, disk_w: 0 KB 111 1.1 christos 112 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 113 1.1 christos 0 2214 1663 find cmdk0 102 0 R 10 114 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 71 115 1.1 christos 116 1.1 christos 2005 Nov 18 15:26:17, load: 0.25, disk_r: 7528 KB, disk_w: 0 KB 117 1.1 christos 118 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 119 1.1 christos 0 2214 1663 find cmdk0 102 0 R 0 120 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 85 121 1.1 christos 122 1.1 christos 2005 Nov 18 15:26:18, load: 0.26, disk_r: 11389 KB, disk_w: 0 KB 123 1.1 christos 124 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 125 1.1 christos 0 2214 1663 find cmdk0 102 0 R 2 126 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 80 127 1.1 christos 128 1.1 christos 2005 Nov 18 15:26:19, load: 0.26, disk_r: 22109 KB, disk_w: 0 KB 129 1.1 christos 130 1.1 christos UID PID PPID CMD DEVICE MAJ MIN D %I/O 131 1.1 christos 0 2215 1663 bart cmdk0 102 0 R 76 132 1.1 christos 133 1.1 christos ^C 134 1.1 christos 135 1.1 christos In the above output, bart and find jostle for disk access as they create 136 1.1 christos a database of file checksums. The command was, 137 1.1 christos 138 1.1 christos find / | bart create -I > /dev/null 139 1.1 christos 140 1.1 christos Note that the %I/O is in terms of 1 disk. A %I/O of say 200 is allowed - it 141 1.1 christos would mean that effectively 2 disks were at 100%, or 4 disks at 50%, etc. 142 1.1 christos 143