vCPU performance between 1 or 2 vCPU's

62

Solution 1

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).

Solution 2

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.

Solution 3

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.

Solution 4

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?

Share:
62

Related videos on Youtube

Rico
Author by

Rico

Updated on September 18, 2022

Comments

  • Rico
    Rico over 1 year

    I would like to create a 5x5 matrix of plots that loop over the n and p variable below. The 25 "small multiples" are arranged into one graphic. This can be done in ggplot2, but the non-ggplot solutions are also welcome.

    Here is my start:

    n <- 1000
    p <- 0.01
    bd1 <- rbinom(n, n, p)
    bins <- seq(min(bd1), max(bd1), 1) # optional count bins
    
    ggplot() + geom_histogram(aes(x = bd1, y =..count..), breaks = bins)
    
    count_vector <- c(10,50,100,500,1000)
    prob_vector <- c(0.005, 0.01, 0.05, 0.1, 0.5)
    

    What is the best way to do this?

    • Rico
      Rico over 3 years
      Update: I believe instead of breaks, we can simply use binwidth = 1.
  • MDMarra
    MDMarra over 9 years
    @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.
  • Rico
    Rico over 3 years
    Awesome! oops, yes $0.995^10 = 0.951$, so it's a really low chance of observing even one success.