20

Does anyone have experience with a tool that can provide an indication of disk IO load by filesystem path.

I use to 'iostat' utility, frequently, to learn how much disk activity is taking place on a Linux host. 'iostat' provides a per-device breakdown, so you can see activity on a particular block device. But it doesn't go any deeper than that--you can't, for instance, query the write load generated by 'httpd' in the directory '/var/log/httpd/'.

janneb
  • 3,841
  • 19
  • 22
Ryan B. Lynch
  • 2,026
  • 1
  • 12
  • 13
  • You can't really monitor by filesystem path since by the time the kernel gets to play with the block device there's no information on where in the tree the request is for. Knowing which process is doing the damage, on the other hand, gives you someone to strace, which usually amounts to the same thing in the end. – womble Jun 12 '09 at 23:38
  • 4
    Based on these answers, I've tried both htop and iotop, and it looks like they both have the basic functionality to break down IO rates per process. Some big differences: * htop has lots of functions and measures all kinds of system statistics, whereas iotop only looks at per-process IO rates. * Using iotop for the first time is a little easier, since it's simpler. * iotop's '-o' ("only") flag hides processes not engaging in IO, which is VERY useful when troubleshooting disk hogs. I couldn't find something similar in htop. Both tools work, but I'll use iotop, for this. – Ryan B. Lynch Jun 23 '09 at 19:19
  • 1
    there's also atop, which displays per-process live and historical data interactively. – Tobu Jun 14 '10 at 06:00

3 Answers3

35

Using htop do the following.

htop
F5 (Tree view)
F2 (Setup)
Select columns
Select RBYTES WBYTES
F10 (Done)

And there you go, per process disk I/O, in real time.

Joseph Kern
  • 9,899
  • 4
  • 32
  • 56
21

You can use iotop for that purpose.

I works like normal top, I cannot say much more. Most distributions will have it packaged, but here is its homepage. You will need a recent kernel.

cstamas
  • 6,707
  • 25
  • 42
0

Collectl can also show process I/O loads but since it can also monitor virtually all your other system resources you get it all in one tool. For example, you can look at the top i/o or cpu processes right now along with disk, network, etc. BUT you can also play back historic data and display the same types of data. Further, there are actually 7 different process I/O provided by the kernel. Collectl can show them all and even let you sort on them. -mark