Sockets vs Cores vs vCPUs

MAMProgr

Member
May 5, 2017
4
0
6
31
Hi,

What are the differences between Sockets, Cores, and vCPUs.

For example,
a. 4 Sockets, 1 Core, 1 vCPU.
b. 1 Socket, 4 Cores, 1 vCPU.
c. 1 Socket, 1 Core, 4 vCPUs.
are these 3 VMs have same performance?
 
Hey!
  • Socket is the physical slot for a CPU. It matters if, for instance, you need NUMA (allocated RAM per CPU, which speeds up computation).
  • Core - is the physical core a CPU has. Here it gets a bit confusing - within Proxmox the number of cores equals the number of threads, so if your CPU supports hyper-threading, the cores count is double the physical cores of the CPU. Within Proxmox settings, it tells how many threads per each socket should be allocated.
  • vCPU - by default, it's the product of sockets and cores per socket allocated. To cite the docs:
    In Proxmox VE the maximal number of plugged CPUs is always cores * sockets. To start a VM with less than this total core count of CPUs you may use the vpus setting, it denotes how many vCPUs should be plugged in at VM start.
    As far as i understand, you can start a VM with less vCPUs than set via sockets and cores and increase them upon need (ballooning style).
Given your scenarios:
  1. 4 Sockets, 1 Core, 1 vCPU means that a max of 4 vCPUs are possible, but you are starting a VM (only Linux support) with one vCPU
  2. 1 Socket, 4 Cores, 1 vCPU - same situation - max of 4 vCPUs are possible, but you are starting a VM with one vCPU
  3. 1 Socket, 1 Core, 4 vCPUs - not possible to set it up, as vCPUs are <= sockets * cores.
At the same time:
  1. 4 Sockets, 1 Core, 4 vCPUs - allows for NUMA optimisations if your server has actual 4 sockets
  2. 1 Socket, 4 Cores, 4 vCPUs - identical to previous scenario, if NUMA is not used / considered, but may influence the cost of licensing
To sum up:
  • most likely you don't need to touch vCPU settings
  • more sockets with less cores each (but <= than physical sockets on the system) allows for NUMA optimisation
  • less sockets with more cores each may decrease the licensing costs, since some licenses are socket-based
 
I read the whole thread, but I got more confuse even. I have a 12 core, 24 threads Ryzen 5900x and would like to allocate say 20 of threads for a VM which will be running MacOS Monterey, what should be the appropriate count of sockets and cores?
Thanks a lot!
 
Thanks a lot Dunuin! I made it 4 sockets, 5 CPUs, making a total of 20 vCPUs, but guess it does not make much sense, does it?
 
Thanks a lot Dunuin! I made it 4 sockets, 5 CPUs, making a total of 20 vCPUs, but guess it does not make much sense, does it?
Sockets would only make sense when enabling NUMA, but even then 4 socket wouldn't make sense, as you are using a single socket mainboard and the 5900X only got 2 chiplets.
 
Thanks a lot Dunuin! I made it 4 sockets, 5 CPUs, making a total of 20 vCPUs, but guess it does not make much sense, does it?
Please also read the documentation about non-standard socket/core configurations and MacOS. It should match as close to a real hardware as possible, 24 or 16 is a common core count.
 
Please also read the documentation about non-standard socket/core configurations and MacOS. It should match as close to a real hardware as possible, 24 or 16 is a common core count.
Thanks for the tip. I am considering to use mainly Monterey, and, eventually, Manjaro. So if I assign the full 24 cores to Monterey, then none will be left for other SOs? I am just guessing here… My initial idea was to go 20:Monterey / 4:Manjaro
 
Thanks for the tip. I am considering to use mainly Monterey, and, eventually, Manjaro. So if I assign the full 24 cores to Monterey, then none will be left for other SOs? I am just guessing here… My initial idea was to go 20:Monterey / 4:Manjaro
That depends heavily on what you want to virtualize. The docs I want to mention are
It all may just work, but if it does not ...
 
Hey!
  • Socket is the physical slot for a CPU. It matters if, for instance, you need NUMA (allocated RAM per CPU, which speeds up computation).
  • Core - is the physical core a CPU has. Here it gets a bit confusing - within Proxmox the number of cores equals the number of threads, so if your CPU supports hyper-threading, the cores count is double the physical cores of the CPU. Within Proxmox settings, it tells how many threads per each socket should be allocated.
  • vCPU - by default, it's the product of sockets and cores per socket allocated. To cite the docs: As far as i understand, you can start a VM with less vCPUs than set via sockets and cores and increase them upon need (ballooning style).
Given your scenarios:
  1. 4 Sockets, 1 Core, 1 vCPU means that a max of 4 vCPUs are possible, but you are starting a VM (only Linux support) with one vCPU
  2. 1 Socket, 4 Cores, 1 vCPU - same situation - max of 4 vCPUs are possible, but you are starting a VM with one vCPU
  3. 1 Socket, 1 Core, 4 vCPUs - not possible to set it up, as vCPUs are <= sockets * cores.
At the same time:
  1. 4 Sockets, 1 Core, 4 vCPUs - allows for NUMA optimisations if your server has actual 4 sockets
  2. 1 Socket, 4 Cores, 4 vCPUs - identical to previous scenario, if NUMA is not used / considered, but may influence the cost of licensing
To sum up:
  • most likely you don't need to touch vCPU settings
  • more sockets with less cores each (but <= than physical sockets on the system) allows for NUMA optimisation
  • less sockets with more cores each may decrease the licensing costs, since some licenses are socket-based
I am sorry to be little dunce. Can we take example of a thin machine with proxmox and 4 x AMD GX-420CA SOC with Radeon(tm) HD Graphics (1 Socket) specification.

Upon creation of VM, I am allowed to allocate (MAX) up to 4 sockets and 128 cores. The create VM dialog box says, 512 cores. How is that possible?

1695165996090.png
 
Upon creation of VM, I am allowed to allocate (MAX) up to 4 sockets and 128 cores. The create VM dialog box says, 512 cores. How is that possible?
I don't get your question. This is virtualization and you can virtualize whatever you want, so this is by intent.
 
I don't get your question. This is virtualization and you can virtualize whatever you want, so this is by intent.
Sorry for my bad paraphrasing it. Does this mean that even though I have one socket CPU with four cores and four threads, the Proxmox ingenuity allows for creating 512 fractions of it? And to continue, the four cores become equal to four sockets and the four threads become equal to 128 cores or about 32 cores for each thread? If so, its just WOW!
 
Sorry for my bad paraphrasing it. Does this mean that even though I have one socket CPU with four cores and four threads, the Proxmox ingenuity allows for creating 512 fractions of it? And to continue, the four cores become equal to four sockets and the four threads become equal to 128 cores or about 32 cores for each thread? If so, its just WOW!
Yes. Isn't this normal in a hypervisor? The same is true for storage. I creates a petabyte filesystem on just a few GB (of course empty).
 
  • Like
Reactions: agarg
Sorry for my bad paraphrasing it. Does this mean that even though I have one socket CPU with four cores and four threads, the Proxmox ingenuity allows for creating 512 fractions of it? And to continue, the four cores become equal to four sockets and the four threads become equal to 128 cores or about 32 cores for each thread? If so, its just WOW!

It is perfectly safe if the overall number of cores of all your VMs is greater than the number of cores on the server (for example, 4 VMs each with 4 cores (= total 16) on a machine with only 8 cores). In that case the host system will balance the QEMU execution threads between your server cores, just like if you were running a standard multi-threaded application. However, Proxmox VE will prevent you from starting VMs with more virtual CPU cores than physically available, as this will only bring the performance down due to the cost of context switches.
https://pve.proxmox.com/pve-docs/chapter-qm.html#qm_cpu
 
  • Like
Reactions: agarg
I read the topic, and still there is no clarity. There is a dual-processor server with Intel Xeon(R) Gold 6226R processors. If the socket in the processor configuration dialog is a physical socket on the motherboard, then why can I install more than two sockets? If this is an emulation, why can't I install more than 4 sockets? For example, on a desktop machine with a Ryzen 9 5900 processor and KVM installed, I can configure a virtual machine to use 16 sockets, with 1 core and 1 thread, and the virtual machine sees 16 cores.
 
If the socket in the processor configuration dialog is a physical socket on the motherboard
Its not.
If this is an emulation, why can't I install more than 4 sockets
Because there are no current x86 hardware interconnects to emulate for >4 sockets.

lets make it really simple. under normal circumstances there is almost nothing to be gained by selecting more then one socket for a vm. This option is mostly for software that is licensed on a socket basis, or in very specific circumstances when cpu pinning is required.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!