Is there a command in linux (more specifically on CentOS 5), that shows how many bytes/sec each file is being read in the past few second. A similar tool in Windows 7 is the Resource Monitor, which can show each file's read speed, and it is helpful diagnosing system performance degrade.
migrated from stackoverflow.com Mar 16 '12 at 16:30
This question came from our site for professional and enthusiast programmers.
My favorite is iotop. It will show I/O counts by process.
Other useful commands to investigate I/O hogs:
Start with vmstat; if there are less than 2 processes in I/O wait (wa column), the machine is not I/O starved, and there is a high chance your performance problem is not related to I/O. Look at the swap in/out, high numbers there indicates your system is memory starved.
If your system is indeed I/O starved, iostat can give you a hint of what device, partition or network filesystem is stressed. Sometimes this is enough to guess the culprit.
Sample output for vmstat:
Sample output for iotop: