Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real time view of what processes are reading/writing?

Status
Not open for further replies.

Yrrk

IS-IT--Management
Aug 22, 2004
180
US
i'm aware of lsof that shows which processes have files open. But is there a tool/command/method of seeing real time update(s) of which processes are actually reading/writing at a given moment? Perhaps even which files they're reading/writing to?
 
from man fuser:
DESCRIPTION
fuser displays the PIDs of processes using the specified
files or file systems. In the default display mode, each
file name is followed by a letter denoting the type of
access:

 
As an addition if you want low level details:
Code:
function viewprocess() {
targ=${1:-""}
i=0
           test -z $targ && exit 1>/dev/null
           for all in `fuser $targ`
           do
              all=`echo $all | sed 's/[^0-9]+//'`
              #or: all=${all/[^0-9]+/""}
              strace -p $all 
              i=`expr $i + 1` 
           done
echo -e "\n###Viewed $i processes in $targ###\n"
}
 
Maybe i'm not asking this just right.. lets say i see a lot of IO activity by watching iostat. I can see there is a lot of IO going on but not what process is causing the IO load. I'd basically just like to know which process is causing all the IO load. Perhaps which file it's accessing that's doing all the reading/writing. How would you do this?
 
I'm not familiar with iostat. It is not bundled with distros
I use regularly but it looks to be similar to vmstat -d or -p.
Are you familiar with top? If you are seeing really unusual amounts of i/o using top may be your best place to single out processes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top