I'm trying to check on CPU steal times in a virtual machine. The goal is for me to be able to detect if my app is running in a VM on over-committed hardware.
I'm currently just testing, in preparation for later production.
I was trying to test this on Ubuntu 11.04, running on Virtual Box 4.1.4 on Max OS 10.6.8.
When I run the vmstat command, the man page leads me to believe I should see an "st" column under the CPU section. I don't see this. I just get "us sy id wa".
I can do a "vmstat -s", and I get " 0 stolen cpu ticks". I get 0, even when I load up the host machine to the point that virtual box is getting only 20% of the CPU (and VB is running multiple CPU sucking loops).
I'm getting the impression that vmstat is not detecting stolen CPU cycles in Ubuntu.
Is there something else I should be doing? Or is my basic understanding wrong?
Is there a better way to detect that I'm being starved for CPU time in a VM?