views:

430

answers:

4

Is there a vmstat type command that works per-process that allows you to see how much time a process is blocked waiting for I/O, time in kernel and user code?

A: 

top (1) will show this imformation. You can specify an individual pid with -p

ConcernedOfTunbridgeWells
A: 

Also look at pidstat -d. It lets you see how much each process is reading and writing.

Benji York
+1  A: 

blktrace is what your looking for, block layer information, wait/blocking/busy etc..., very in depth, there are quite a few of packages that derive from it, seekwatcher, ...

Some other tool, simular to what sigjuice said, iotop, is also handy, but less informative for serious analysis. Also I believe btrace/blktrace is much more well suited for I/O tracing than oprofile, which is more general and increases load in comparison.

RandomNickName42
A: 

strace will show you how much time is spent in system call, however it won't tell you how much of this time is spent in waiting versus time really spent for I/O. you can select which system call you want to trace, or which type, it is quite powerful

latencytop would be another good tool, because your process can be waiting for I/O because of other processes, or because of some journalling daemon.

shodanex