VMware Cloud Community
powers
Enthusiast
Enthusiast

VM using 100% of cpu, but only 1 of 8 cpus?

I have a VM running a very badly coded application which causes it to sit at around 100% CPU utilisation.

The VM has only one processor, the ESX host has 8 processors. (3Ghz each)

Looking at the CPU performance graph, the VM never gets higher than 3GHhz.

What I don't understand is the relationship between the VM CPU and the host CPUs. Shouldn't the VM be able to access 100% of all 8 CPUS if it needs them?

The resource setting is unlimited for CPU and its set to Normal for shares. (as are all VMs on the host)

Can someone please shed some light on this?

Thanks

0 Kudos
6 Replies
Gerrit_Lehr
Commander
Commander

No, the execution of one vCPUs operations can't be balacend over different physical CPUs. What is possible is to add more then one vCPU to the VM and those vCPUs will then be scheduled and balanced over the physical CPUs. However, this is only recommended, when the VM really uses the addidional vCPUs (depending on the software used), otherwise is causes performance disadvanteages because moveing the vCPU from one physical CPU to another is a difficult procedure and causes high load.

Kind Regards,

Gerrit Lehr

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

Kind regards, Gerrit Lehr If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
mike_laspina
Champion
Champion

Hi,

The VM will not be allowed to pin the host. This is a protective function of the Hypervisor partitioning.

Shares are good when there is competition for the resources of the host or cluster etc. but doesn't do much otherwise

The VM is granted 1 CPU therefore that is the maximum for that VM, its no different than real iron.

Note: If this was a p2v and the source was using more than 1 CPU then you should grant it more than one due to the previous SMP HAL OS configuration.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
powers
Enthusiast
Enthusiast

Interesting. I thought that a physical CPU was scheduled at random each time a VM sends an execution task to it's virtual CPU. . So it works more like a VM having an affinity set to a CPU?

So if I have 8 VMs each VM will use its own CPU? And if I introduced a 9th VM ?

0 Kudos
mike_laspina
Champion
Champion

The Hypervisior scheduler will try to keep the VM's threads on 1 pCPU. And if it went across two it's still carved out as 1 CPU resource unit of 8.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
Gerrit_Lehr
Commander
Commander

Well, different vCPUs can be executed on one physical CPU, and as I said, ESX moves the vCPUs between the physicals to balance the load optimal. So if you have 8 physical and 24 vCPUs, it doesn't mean that every physical CPU executes 3 vCPUs all the time, it depends on the load of the CPUs and changes due to CPU loads.

Kind Regards,

Gerrit Lehr

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

Kind regards, Gerrit Lehr If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
weinstein5
Immortal
Immortal

To pull together what others have been saying - the vmkernel, the virtualization layer, schedules a vcpu to run on a eingle physical cpu core or hyperthread. So in your instance you have a poor application that utilizes all of the cpu the the vmkernel at most will give your vm/application one cpu - that is why you see only a maximum of 3 GHz of cpu consumption for your vm - shares will only come into play if the the vms on your are fighting for cpu cycles - for example you have 16 instances of this poor application running on your host and all have equal share each vm will get approximately 1.5 GHz of a physical cpu -

Someone had suggested adding a second vcpu to give it more cycles - this would only work if the O/S it was running on and the application itself was multithreaded because only then would it be able to take advantage of the second vcpu -

And two answer your question about 9 vms - the vmkernel tries to balance the load across all physical cpus and along with the service console - so depending on the spu load you will see a the load beeing balanced with the vms movinc between pcpus as the load fluctuates -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos