VMware Cloud Community
sfresher
Contributor
Contributor

Double the guest VM vCPU to double its total CPU power?

I have a server which has (2) quad-core CPUs, so I can assign up to 8 vCPU to the guest VM.  My guest contains both Windows and Linux.  Let's say I assign only 1 vCPU to a VM, so the max cpu power it can get is 1/8 of the physcial cpu power.  In another word, if I make it a 2 vCPU VM, it's cpu ppwer will be doubled.  Am I right?

Reply
0 Kudos
9 Replies
a_p_
Leadership
Leadership

This depends on the number of VMs you are running and their workload. If the CPUs are not highly utilized, you may get more CPU power for an individual VM, provided the software running on this VM is CPU aware (can take advantage of the additional vCPU).

André

Reply
0 Kudos
MauroBonder
VMware Employee
VMware Employee

No, you can not compare the 1vcpu 1 / 8 even for the virtual machine does not use 1vCPU whole, it can use only what is necessary to perform what she needs and the rest is in the vCPU wating and VMware controls the interruption.
Take a look at how the CPU works in VMware vSphere http://www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf

Other thing is: Have application that works better with Single vCPU and not with 2 or + vCPU. Depends of architeture of application.


Please, don't forget the awarding points for "helpful" and/or "correct" answers.

Mauro Bonder - Moderator

*Please, don't forget the awarding points for "helpful" and/or "correct" answers. *Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema.* Thank you/Obrigado
Reply
0 Kudos
sfresher
Contributor
Contributor

I was wondering if the guest VM total CPU power is not proportional to its vCPU number, why would I see that a VM is consistly heavily loaded with 100% cpu, but its host is only loaded with 30% cpu.  And the resource reservation for that VM is set to up to unlimited.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

If from within a VM the CPU utilization is pegged at 100% make sure that whatever is using the resources is legitimate. Is this a runaway process or some other application issue? If the process or app is actually using the CPU for real work then you can try adding a second CPU. Not all applications can make use of additional processors.

-- David -- VMware Communities Moderator
Reply
0 Kudos
sfresher
Contributor
Contributor

We are doing some moderate performance testing on the VM.  I was expecting that the ESXi itself should allocate more CPU power to the VM, especially since the host only loads 30% of its CPU.  But appearently it was not the way. 

Didn't anyone see issue similar to mine?

Reply
0 Kudos
a_p_
Leadership
Leadership

One vCPU assigned to a VM corresponds to one physical core (not regarding HyperThreading at this point). This means that the threads/tasks which are running within the VM are executed on one core. ESXi does not distribute these threads to different physical cores, because this would require to interact with the OS in the guest.

André

Reply
0 Kudos
sfresher
Contributor
Contributor

What does this mean?  Does this mean that if I have only one guest VM on an ESXi, there is no way I can utilize the full power of the physical server?  Asssuming I assign max vCPU to the VM, but if the application on the guest VM cannot benefit from mutilple vCPU on the guest, I ended up only a fraction of the ful power of the physical server?

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

You can assign more than one vCPU to a guest up to the maximum allowed by your VMware license level and the max allowed by your guest OS. There isn't a dynamic allocation of CPU resources to a virtual guest. Test your application under different loads and resource allocations. Find a balance that will satisfy performance and the needs of your other virtual machines.

-- David -- VMware Communities Moderator
Reply
0 Kudos
a_p_
Leadership
Leadership

Assuming I assign max vCPU to the VM, but if the application on the  guest VM cannot benefit from mutilple vCPU on the guest, I ended up only  a fraction of the ful power of the physical server?

If an application is not CPU aware it does not matter whether it runs on the physical hardware or in a VM. In either case it will not benefit much from multiple CPUs/Cores.

André

Reply
0 Kudos