The vSphere limit effect

VMware Limit Effect on Linux top

VMware Limit Effect on Linux top

I believe the effects of limiting a guests CPU in vsphere are well understood but I for one don’t like the way VMware implement this. I have just verified the behaviour on ESXi 5.0.0 is the same as 4.1 (which is only to be expected).

Guests get confused, is the bottom line. At least Linux does, which is particularly noticable with “top”. In the screenshot above of a Centos guest, I have limited the CPU to 1000Mhz using virtualcenter. To me, it would be logical that the guest O/S would be presented with a 1000Mhz CPU but this is not the case. The output of /proc/cpuinfo means that Linux thinks it is running on a 3.47Ghz i5. Is it really hard to do, or something?

The upshot is that when the guest is maxed out, as in the screenshot, top shows 100% us time (correct) but only 29% of the CPU. Which is correct if you consider the pCPU but not, if like me you don’t think a guest should have any knowledge of the real hardware. I think Centos should see a 1000Mhz vCPU and top will correctly display 100% CPU Time.

Must check this on other hypervisors (Xen and KVM) sometime.

P.S.
Saddened to hear of the death of Dennis Ritchie today. Someone who I can identify as having a large impact on my life, though I never knew or met him. Such is the world we live in. Eventually we will all exit(0).

Leave a Reply