Possible Duplicate:
Linux: Is there something similar to "top" for I/O?

I am trying to do some CPU intensive operation on a Linux machine and it is showing very high load.

I want to figure out if this load is due to I/O or CPU usage. How could I get the percentage of I/O usage by process?

link|improve this question
feedback

migrated from stackoverflow.com Aug 10 '11 at 9:46

This question came from our site for professional and enthusiast programmers.

closed as exact duplicate by slhck, Breakthrough, Linker3000, paradroid, Nifle Aug 10 '11 at 19:19

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

3 Answers

Try program called "iotop". It shows usage of local disk drives in similar way than "top" for CPU usage. For network traffic there's a tool called "iftop".

Also, if you uncertain about why the load is high, look at the "IO Wait" column on "top" view. If the CPU time mainly goes to "user" or "system" work, then it's CPU that's the bottleneck, if "IO wait", then disk. Also worth looking are swap numbers - if the physical memory has less than 5% free and/or lot of swap file is used, you might be limited by physical memory.

For example:

top - 17:18:37 up 1 day,  5:20, 19 users,  load average: 0.18, 0.26, 0.35
Tasks: 249 total,   2 running, 246 sleeping,   0 stopped,   1 zombie
Cpu(s):  8.5%us,  2.1%sy,  0.3%ni, 85.4%id,  3.7%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   8183668k total,  8082464k used,   101204k free,    11148k buffers
Swap: 11847900k total,   248528k used, 11599372k free,  3361444k cached

"us" stands for userspace code, "sy" for system, "id" for idle, "wa" for IO wait.

link|improve this answer
feedback

Take a look at the Linux proc fs

link|improve this answer
feedback

To start with, you can run top and look at the total CPU usage in the third line of the display. If the load averages in the first line are high, but the CPU usage in the third line is low, then the problem is I/O usage. To narrow it down more specifically from there you can then use iotop, like Zds suggested.

link|improve this answer
feedback