Within virtualisation (Predominantly VMware) is there a performance advantage using either 1 CPU with 4 cores or 2 CPU's with 2 cores? Let's assume the application running on a VM can use two CPU's.
4 Answers
Not considerable enough to make an impact. The adjustments are more for licensing. For example, Windows Server is licensed per processor slot, so you'd pay more to have 1 core and 4 CPUs than to have 1 CPU and 4 cores.
Same goes with other products whose costs quickly rise with more processors (looking at you, Oracle).
![](../../users/profiles/173547.webp)
- 14,901
- 4
- 42
- 62
-
7Brace yourselves... Oracle quotes are coming... – Ryan Ries Oct 17 '14 at 14:12
-
4@RyanRies last I looked, Oracle made you license their products based on physical CPUs in the hypervisor, not virtual CPUs in the guest, rendering you unable to avoid the total boning by Oracle. Not sure if this is still the case, but it wouldn't surprise me. – MDMarra Oct 17 '14 at 19:09
Short answer: Probably none that you would notice.
Long answer: Maybe. The issue that comes to my mind first and foremost is that modern CPUs operate much faster than the main memory they use. This is the primary reason why NUMA (non-uniform memory access) was invented. CPUs on the same die (ex. two cores on the same chip) would share the same NUMA node... and they would both access memory from this node faster than they could access the memory from another NUMA node. So if you are building a computer that is going to have many cores and many physical processors, keep NUMA node locality in mind. If a processor has to access memory that is far away it will be slower.
NUMA is not going to be an issue for you if your machine only has one or two processors, but I thought I would mention it anyway, just for completeness' sake.
![](../../users/profiles/104624.webp)
- 55,011
- 9
- 138
- 197
While there shouldn't be a difference here, my benchmarks have shown a slight (but clean nonetheless) performance increase in Windows guests when using single core multi-socket emulation (e.g. 4 vCPUs are mapped as 4 sockets, single core, single thread). No visible difference in Linux guests though.
Tests were done on KVM, using Windows 2003R2 and 2008R2 guests and RHEL5 and RHEL6 guests for the Linux side of things. My guess is Windows tries to do some extra scheduling tricks that either excel on multiple sockets or fail on multiple cores.
![](../../users/profiles/13543.webp)
- 18,482
- 6
- 48
- 63
There's no major difference here. The main purpose of the cores/socket designation is to provide options for software that may have runtime or licensing requirements based on the number of "physical" sockets or CPU cores (cough, databases...)
There's no significant performance difference between multiple cores on one socket versus a combination of multiple sockets, there IS a slight difference in operation if you enable or require the CPU hot-add feature of the virtual machine (provided you have Enterprise or higher licensing).
For CPU hot-add, you add in increments of sockets, not cores... so if you have a single socket with 4 cores, a CPU hot-add operation in vSphere would take you to two sockets and 8 cores.
Alternatively, if you had two sockets of 2 cores, a hot-add would bring you to three sockets and 6 cores.
See: In VMware ESXi 5.x, does it make a difference if I select 2 CPU cores vs. 2 CPU sockets?