iotop but for particular disk?
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:
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
Related videos on Youtube
Axel
Updated on September 18, 2022Comments
-
Axel almost 2 years
Is there a tool like
iotop
but for monitoring IO on specific volumes? (Or perhaps I missed a way to filteriotop
?) 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 over 6 yearsthat splits up activity by disc, but not by process which is the key feature of iotop
-
Luc about 5 yearsWhy 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 over 2 yearsthis 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 over 2 yearsoh 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 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 over 2 yearshmmm... 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 over 2 yearsfor 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.