15

Is there a tool like iotop but for monitoring IO on specific volumes? (Or perhaps I missed a way to filter iotop?) If not is there any way to get at this information via (say)/proc? (dstat etc. only show aggregate activity across all processes per volume, whereas I'm interested in seeing how much each process is contributing.)

2

This isn't an ideal answer, but this will tell you, every second, what process wrote the most, and how much it wrote, to a given disk (in this case /dev/sda):

dstat -tdD /dev/sda --top-io

You'll see something like:

dstat output

3
  • this is helpful but it doesn't seem to limit the io reporting to the disk you specify... no matter what disk I pass on the command line, the top io process comes up.
    – stu
    Nov 8 at 19:56
  • 1
    oh I see, the io on the disk is on the left, the process is on the right, and the process isn't limited to the specified disk, but the read/write on the left is. thanks
    – stu
    Nov 8 at 19:58
  • @stu Yes, exactly. There may be IO to other disks too, but this should be only for the disk you specify. Nov 10 at 16:00
1

As there are no answers yet...

I do not have an easy suggestion (like an iotop switch) but if this is important to you then you may write a FUSE module which just remounts the file systems elsewhere (chroot for the process to be examined) and counts the amount of data read / written. That should be a rather easy adaption of existing modules. You may ask the FUSE community which might be the best existing solution to start from. Probably even their demo module will do.

1

You can use iostat to monitor disk I/O for performance issues.

$ iostat -xd /proc
2
  • 4
    that splits up activity by disc, but not by process which is the key feature of iotop
    – frankster
    Nov 29 '17 at 13:09
  • Why add -d /proc? That will never give anything afaict, because /proc is not a device. You'd want to run it without that to see all devices, i.e. iostat -x. Heck, even the -x can be left out if you're not looking for obscure stats like "aqu-sz". Other than that, though, this is the tool I was looking for. It doesn't do by process, but I have one process reading from multiple disks and dominating my iotop stats, so I can estimate how much data is read from each device. Thanks!
    – Luc
    May 11 '19 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.