G''Day Folks,
I seem to be writing tools in pairs these days, an event based tool to
list activity in real time (*snoop), and a summary based tool to give
[interval [count]] based reports (*stat|*top).
I''ve just written a disk I/O summary tool called iotop,
# iotop -C
Sampling... Please wait.
2005 Jul 16 00:31:38, load: 1.03, disk_r: 5023 Kb, disk_w: 22 Kb
UID PID PPID CMD DEVICE MAJ MIN D BYTES
0 27740 20320 tar cmdk0 102 16 W 23040
0 27739 20320 find cmdk0 102 0 R 668672
0 27740 20320 tar cmdk0 102 16 R 1512960
0 27740 20320 tar cmdk0 102 3 R 3108864
2005 Jul 16 00:31:43, load: 1.06, disk_r: 8234 Kb, disk_w: 0 Kb
UID PID PPID CMD DEVICE MAJ MIN D BYTES
0 27739 20320 find cmdk0 102 0 R 1402880
0 27740 20320 tar cmdk0 102 3 R 7069696
[...]
Without the -C it will clear the screen in William LeFebvre''s
traditional
top style.
Ok, so bytes are merely a yardstick - they could be random bytes or
sequential bytes. What we *really* need is to time disk events and
figure out time the disk has spent satisfying requests - which is
effectively measuring a %busy by process rather than a bytes by process.
Here we print these times using -o,
# iotop -Co
Sampling... Please wait.
2005 Jul 16 00:39:03, load: 1.10, disk_r: 5302 Kb, disk_w: 20 Kb
UID PID PPID CMD DEVICE MAJ MIN D DISKTIME
0 0 0 sched cmdk0 102 0 W 532
0 0 0 sched cmdk0 102 0 R 245398
0 27758 20320 find cmdk0 102 0 R 3094794
2005 Jul 16 00:39:08, load: 1.14, disk_r: 5268 Kb, disk_w: 273 Kb
UID PID PPID CMD DEVICE MAJ MIN D DISKTIME
0 3 0 fsflush cmdk0 102 0 W 2834
0 0 0 sched cmdk0 102 0 W 263527
0 0 0 sched cmdk0 102 0 R 285015
0 3 0 fsflush cmdk0 102 0 R 519187
0 27758 20320 find cmdk0 102 0 R 2429232
[...]
Since the above was 5 second samples, divide the disktime (us) by 5
seconds and you have %busy. iostat agrees.
What it''s doing isn''t new, iosnoop does that, this is just the
summary
tool rather than the event based tool (I should have written this yonks
ago :-).
...
It''s on my website, toolkit soon.
cheers!
Brendan
[Sydney, Australia]