Is there a linux command that allows you to see a processes IO wait time vs. CPU time? I'm trying to see whether some processes are IO-bound or CPU-bound.
5 Answers
I think iostat is the basic tool you want.
-
Handy tip... "iostat 30" will give you overall stats on startup, then update every 30 seconds with activity from the last 30 seconds. The initial display will give you a snapshot of overall IO usage, and the regular update will indicate whether the system is IO bound now. May 15, 2009 at 0:28
If you install the atsar package you can look at the system's CPU and I/O stats. Simply using top should give let you know if the a particular process is CPU or memory bound. I am not sure how you see the I/O stats for a particular process.
top (1) will show this information. You can specify a particular process ID with -p
.
Try mpstat and look at %iowait.
[pdurbin@beamish ~]$ mpstat 1 5
Linux 2.6.18-128.1.10.el5 (beamish) 05/14/2009
03:25:27 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
03:25:28 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 1073.00
03:25:29 PM all 0.25 0.00 0.50 0.00 0.00 0.25 0.00 99.00 1202.00
03:25:30 PM all 1.50 0.00 0.00 0.00 0.00 0.00 0.00 98.50 1071.00
03:25:31 PM all 0.25 0.00 0.00 0.00 0.00 0.00 0.00 99.75 1150.00
03:25:32 PM all 0.25 0.00 0.00 0.00 0.00 0.00 0.00 99.75 1086.00
Average: all 0.45 0.00 0.10 0.00 0.00 0.05 0.00 99.40 1116.40