VM CPU: 2x4 cores vs 1x8 cores

alexc

Renowned Member
Apr 13, 2015
138
4
83
I really wondered if VM with 2 sockets / 4 cores is better vs VM with 1 socket / 8 cores.

i think overhead of having 2 sockets is noticeable so 1s/8cis easier for OS to manage.

May there be any real recommendations on that?

Thank you for advices!
 
I don't think it really matters, since ultimately cores*sockets (i.e. # of vCPUs) ends up as the number of threads on the host.

Per the documentation:

A CPU socket is a physical slot on a PC motherboard where you can plug a CPU. This CPU can then contain one or many cores, which are independent processing units. Whether you have a single CPU socket with 4 cores, or two CPU sockets with two cores is mostly irrelevant from a performance point of view.
...
Increasing the number of virtual cpus (cores and sockets) will usually provide a performance improvement though that is heavily dependent on the use of the VM. Multithreaded applications will of course benefit from a large number of virtual cpus, as for each virtual cpu you add, Qemu will create a new thread of execution on the host system.

https://forum.proxmox.com/threads/cpu-sockets-vs-cores-socket.2299/post-12312

On a related note, if you really have two physical sockets on your server, you should probably also be enabling NUMA (you should probably also be enabling NUMA on AMD Ryzen CPUs as well due to their chiplet architecture).

There may be a benefit to having the VM match the number of physical sockets you have, but that may just be what we called in med school a "black pearl of wisdom" (i.e. a pearl of wisdom that turns out to not actually be true). As such I don't have any performance studies to back that up one way or another, but I think it's likely not true, especially in the current era where NUMA exists.

-TorqueWrench
 
Last edited:

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!