Occasionally my Macbook Pro will slow down as the hard drive clicks away endlessly. CPU load is low, but applications and menuitems are slow to respond. Is there a utility that can help me determine what's going on, such as the number of bytes read/written or files open/closed per process, over time?
Answer
From man iotop
:
iotop tracks disk I/O by process, and prints a summary report that is refreshed every interval.
This is measuring disk events that have made it past system caches.
Since this uses DTrace, only the root user or users with the dtrace_kernel privilege can run this command.
This may not be precisely what you want - but it's a ksh script which wraps around dtrace, so you should be able to figure out how to make dtrace do what you need, if iotop doesn't handle it by default.
However, something like iotop -C 5 12
should give you something to start with: it will output 12 samples, each 5 seconds long.
Comments
Post a Comment