Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off-topic by Michael Hampton Nov 28 '15 at 9:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Michael Hampton
If this question can be reworded to fit the rules in the help center, please edit the question.

VirtualBox doesn't provide CPU steal time data. Try again with a different hypervisor, preferably the one that will actually be used in production. – Michael Hampton Nov 28 '15 at 9:40

If you run top you should see a line for Cpu(s): . At the end of the CPU line is ‘%st’. That stands for 'Steal Time'. Steal time is the time that the CPU was running something, but the hypervisor is running something else instead.

If you don't see %st in top or ‘Stolen CPU ticks’ in ‘vmstat -s’, then I would try and upgrade your installation of procps.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.