What are the limits of allocating my CPU cores to VMs?
If you're using vSphere (which I assume you are as you tagged
vmware, when you allocate 1 CPU core you're allocating 1 vCPU core. The CPU does not bind to a physical CPU core (pCPU).
For vSphere 6.0, there is a maximum of 32 vCPUs per physical core, and vSphere administrators can allocate up to 4,096 vCPUs to virtual machines on a single host, although the actual achievable number of vCPUs per core depends on the workload and specifics of the hardware.
For every workload beyond a 1:1 vCPU to pCPU ratio to get processor time, the vSphere hypervisor must invoke processor scheduling to distribute processor time to virtual machines that need it. Therefore, if the vSphere administrator has created a 5:1 vCPU to pCPU ratio, each processor is supporting five vCPUs. The higher the ratio becomes, the higher the performance impact will be, because you have to account for the length of time that a virtual machine has to wait for physical processors to become available. The metric that is by far the most useful when looking at CPU oversubscription, and when determining how long virtual machines have to wait for processor time, is CPU Ready.
The vCPU-to-pCPU ratio to aim to achieve in your design depends upon the application you are virtualizing. In the absence of any empirical data, which is generally the case on a heterogeneous cloud platform, it is a good practice, through the use of templates and blueprints, to encourage your service consumers to start with a single vCPU and scale out when it is necessary. While multiple vCPUs are great for workloads that support parallelization, this is counterproductive in the case for applications that do not have built in multi-threaded structures. Therefore, while a virtual machine with 4 vCPUs will require the hypervisor to wait for 4 pCPUs to become available, on a particularly busy ESXi host with other virtual machines, this could take significantly longer than if the VM in question only had a single vCPU. This performance impact is further extended as the vSphere ESXi scheduling mechanism prefers to use the same vCPU-to-pCPU mapping to boost performance through CPU caching on the socket.
You can also search for 'virtual machine cpu overcommit' for more results.
I find a good rule of thumb if using VMware Workstation is 1 CPU with two cores. This works well for Windows Guests and Linux Guests.
You are not limited by the number of cores you have as to the number of machines. My laptop has 4 cores and I run a Windows 10 Host with 3 guests: Windows 7, Kali, and Ubuntu.
I assign 3 GB of memory to each machine and have 16GB of memory total.
The biggest performance boost I get is from a very fast NVMe SSD.