iotop but for particular disk?

13,638

Solution 1

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

Solution 2

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.

Solution 3

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

$ iostat -xd /proc
Share:
13,638

Related videos on Youtube

Axel
Author by

Axel

Updated on September 18, 2022

Comments

  • Axel
    Axel almost 2 years

    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.)

  • frankster
    frankster over 6 years
    that splits up activity by disc, but not by process which is the key feature of iotop
  • Luc
    Luc about 5 years
    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!
  • stu
    stu over 2 years
    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
    stu over 2 years
    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
  • Ryan Shillington
    Ryan Shillington over 2 years
    @stu Yes, exactly. There may be IO to other disks too, but this should be only for the disk you specify.
  • stu
    stu over 2 years
    hmmm... getting back to this, it looks now like I read this wrong. the process is the most expensive process overall (including all disks it writes to) and the io going to the disk is on the left, but that doesn't actually mean that the most expensive process is the one doing all the writing to the disk in the left column, does it? really hard to read.
  • stu
    stu over 2 years
    for anybody else looking, I hadn't heard of fatrace, it doesn't tell you how much data is moving, but it does tell you what files, and you can limit it to a filesystem.