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??
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.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 3  Replies