Disk I/O per Process

iomonitoringprocess

I want to check which process taking highest I/O. To be exact I want to check which process doing the highest write operation and how much.

I know there are some tools like iotop. But as I have to work without a sudo and a foreign environment with very limited privilege I want to know how can I achieve this with built-in tools like ps. I want something like the following which I use to find CPU/Memory usage,

$ps -eo pid,command,%cpu,%mem --sort=-%cpu

Update: After trying several ways I found that I can't read /proc/[pid]/io file due to lack of privillage so no way to get I/O without proper privilege I guess.

 $cd /proc/; for i in $(ls | egrep -o ^\[0-9\]*); do cat $i/io; done
 cat: 1/io: Permission denied
 cat: 10/io: Permission denied
 cat: 10284/io: Permission denied
 cat: 11/io: Permission denied
 cat: 1174/io: Permission denied
 cat: 12/io: Permission denied
 ........

Best Answer

The problem is that you do not have access to this information as ordinary user for other users' processes.

Related Question