[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I/O Wait and CPU Usage



Grok Mogger wrote:
I have a question about the "wa" fields in vmstat, top, and the like. I and someone else I know have both read a great deal about its meaning, and have come to two different conclusions. Here are our interpretations. Could someone please tell me which interpretation is right? Thanks!



Interpretation A:

"wa" reflects time that your cpu is waiting on hard disks and network. It is basically the same as "idle" time. If your CPU had more work to do, it could do it. So in a situation like this.... (I'm simplifying the example to get the point across)

10%us   10%sy   30%id   50%wa

The CPU is really truly 80% idle. It's only using 20% of its capacity, and if it had enough work to fill the remaining 80%, it could and would. You'd see 100% allocated between us and sy, and 0% on id and wa.

In this interpretation, "wa" is really just helpful because it tells you how much more of your CPU would be allocated between us and sy if your hard disks and network could keep up with your CPU. It gives you some impression of the bottleneck your I/O currently is on your PC.



Interpretation B:

"wa" reflects the time your CPU is waiting on hard disks and network. But it is NOT the same as "id". If your CPU had more work to do, it could not "allocate" wa time to that work, only id time. So in a situation like this....

10%us   10%sy   30%id   50%wa

The CPU is really only 30% idle. It's actually using a whopping 70% of its capacity, and only has another 30% to allocate to more work. If the CPU had a ton of work to do, the best you'd see is 50% allocated between us and sy, and 50% allocated to wa with 0% id.

In this interpretation, "wa" is really like "blocked" CPU time. The CPU has processes that are not really doing anything, because they are waiting on slow hard disks and network I/O, *but* these waiting processes still prevent that much CPU from being used.



So which is it?  (Or is it neither?)

Thanks in advance everyone,
- GM



I wonder what the -ck mailing list would say:
http://members.optusnet.com.au/ckolivas/kernel/

Hugo






Reply to: