25 pts.
 VM configuration – Why does increasing the number of VCPUs beyond those of phyical CPUs lead to poor performance?
Why does increasing the number of VCPUs beyond those of phyical CPUs lead to poor performance?

Software/Hardware used:
ASKED: May 31, 2008  6:43 AM
UPDATED: June 9, 2008  4:55 PM

Answer Wiki:
If you are configuring more vCPUs than physical CPUs exist then some of the physical CPUs will be assigned to the VM more than once. As far as the virtual machine knows each vCPU is a different physical CPU so it will send load to them thinking that. However is the physical world you know how one CPU getting 200% of it's possible workload.
Last Wiki Answer Submitted:  May 31, 2008  9:01 pm  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

But this happens even in the case of 1 virtual machine (i.e 1 VM 4 VCPUs and only 2 physical CPUs).

 25 pts.

 

Suppose there are 2 physical CPUs. Comparing 4 VCPUs and 2 VCPUs with 4 workloads. Theoretically, both should have the same performance. But this is not the case. I was actually referring to this case. I think both the cases each physical CPU gets same workload. Can you say Why??

 25 pts.

 

You can never assign a VM more vCPU’s then physical cpu cores that the host server has. You should also never assign a VM the same number of vCPU’s that the host server has cpu cores. For example, don’t create a 4 vCPU VM on a host that has 2 dual core cpu’s. The reason for this is that when you have multi-cpu VM’s the hypervisor’s cpu scheduler must find simultaneous cpu’s/core’s available equal to the number assigned to the VM. So a 4 vCPU VM will need to have 4 free cpu’s/core’s available on the host for every cpu request which is no easy task on a host that only has 4 cpu’s/core’s. Most VM’s run well with only a single vCPU and can actually run slower with multiple vCPU’s. If you do need to create multiple cpu VM’s then make sure you have plenty of cores available. If you need to create a 4 vCPU VM it is best to have at least 8 core’s available on the host server. The VM will never be aware of which cpu/core it is running on since this is handled transparently by the scheduler. If you do want to dedicate a physical cpu/core to a VM then you can use affinity but this is not recommended because it can prevent from advanced features from working. The cpu scheduler of the hypervisor does a very good job of handling requests and it is best to leave it to schedule resources and not use affinity.

 675 pts.