If R (runqueue) is greater than B (waitqueue) in vmstat, is it I/O bound

cpu usage

If the runqueue is the number of processes waiting for their turn on the CPU + processes currently running, and waitqueue is the number of processes waiting for I/O, then wouldn’t B in the vmstat output being greater than R mean that there is an I/O bound, not CPU bound? I am confused because the link below says the opposite …
From http://nonfunctionaltestingtools.blogspot.com/2013/03/vmstat-output-explained.html?m=1

“If runnable threads (r) divided by the number of CPU is greater than one -> possible CPU bottleneck (The (r) coulmn should be compared with number of CPUs (logical CPUs as in uptime) if we have enough CPUs or we have more threads.) High numbers in the blocked processes column (b) indicates slow disks. (r) should always be higher than (b); if it is not, it usually means you have a CPU bottleneck”

Best Answer

A higher number in b than in r means the CPUs are often idle, so you are right being confused. The document should have read 'means you have an I/O bottleneck'.

Beware that the page says r should never be higher than the number of CPUs, and r=16 on a 12 CPU system is a "serious" problem. This is quite exaggerated. That just means CPUs are fully used and some threads are waiting. Usually no big deal.

Finally, don't confuse threads and processes, like the linked document sometimes does too. The r and b columns show number of threads, not processes. Not all processes are single threaded.

Related Question