>> I've been wondering how to get this sort of info out of existing tools >> (lsof, top, etc) without success. iostat which is part of the sysstat package is highly useful in this context...
Yes, iostats is useful, and has been around since the dawn of time but I'm after something a little more intuitive, iostat can't handle a PID as an argument.
For example :
NAME PID BLOCKS/W BLOCKS/R KB/s FD "FILE NAME" DEVICE httpd 4836 45 1 53 13 /var/log/httpd/xxx /dev/hda2
And so on..
Diagnosing disk IO problems would be far easier if one had a tool that could give "at a glace" detail into what is doing what and where.. iostat shows you what disk, or which partition is busy, but not what PID is doing the io. So one must go back to lsof and get a list of open handles on that partition or device and guess which one is pushing the ops/blocks.