How many vCPU for VM ?
The discussion about number of vCPU for VM is flowing around from time to time. There is no simple answer on that questions as well as there is no Best Practice as such. Answer depends on various factors such as:
- Is installed application SMP aware ?
- what are the software vendor requirements ? Keep in mind that software vendors always overestimates in terms of hardware requirements 🙂
- How big is NUMA node on server
- What is expected vCPU utilisation on VM
But, there are some general rules, I would say Good Practice, which you would like to keep in mind when you make a decision:
- Start with minimum configuration, 1 vCPU, and monitor VM performance, if you notice performance problems caused by lack of CPU resources, add more vCPU to VM. And again, monitor VM for some time.
Very helpful feature which make your life easier is a Hot-Plug for CPU and RAM. CPU and RAM Hot-Plug for VM’s was introduced with vSphere 4 and it works very good. If you have a operating system on virtual machine which supports hot-add for RAM and CPU, enable this feature in VM virtual hardware.
BTW, I noticed that Hot-Add feature is not so popular among admins and engineers, wondering why. I definitely recommend to enable it.
- Do not exceed size of NUMA node on physical server
Let’s say physical host has 2 x QUAD processors and 96GB RAM, single NUMA node has 4 pCPU and 48GB RAM, it means that the biggest VM can have 4 vCPU and 48GB RAM. Of course you can assign more resources to VM but its performance will drop down because scheduler will have to schedule vCPU and RAM on another NUMA node using slower BUS. More information about NUMA node you can find in a link repository below.
Having in mind above information one can make decision easier and more adequate to virtual machine and application needs. Your VM’s will be nice and tide, capacity management become a pleasure and you can squeeze more VM into your vSphere cluster 🙂