Allocating CPU to VMs

Boss

New Member
Apr 22, 2024
24
0
1
Hi - If I wanted to allocate 6 cores to a VM - is there a difference in performance between allocating:
1 socket + 6 cores or​
2 sockets + 3 cores​
 
Yes - I meant allocating cpu to the VMs
The servers we've used for Proxomox have 2 sockets with 12 threads each.
Not sure what the last line means in the NUMA reference?
If the NUMA option is used, it is recommended to set the number of sockets to the number of nodes of the host system.
 
If the NUMA option is used, it is recommended to set the number of sockets to the number of nodes of the host system.
This means that the number of sockets you configure for the VM should match the number of NUMA nodes of the host system the VM is running on. You can use `lscpu | grep "NUMA node(" to figure out how many NUMA nodes your host system has. Typically, the number of NUMA nodes of the host system matches the number of sockets.

So assuming the command above outputs something likes this on your host:

Code:
$ lscpu | grep "NUMA node("
NUMA node(s):                         2

Then you should enable the NUMA option for your VM and set it up with 2 sockets. If you want it to have a total of 6 VCPUs, then you should configure it with 2 sockets and 3 cores, as you mentioned to begin with.
 
Ahh - understood - thanks.
I guess this is only useful if you allocate an even number of vCPUs - ie: 2, 4, 6 ....
And if you allocate an odd number of vCPUs then only allocate 1 socket and the number of cores required.
 
I guess this is only useful if you allocate an even number of vCPUs - ie: 2, 4, 6 ....
And if you allocate an odd number of vCPUs then only allocate 1 socket and the number of cores required.
Well, usually you wouldn't populate two sockets with odd numbered CPU cores in real-life either. The socket option has two main uses-cases (from my knowledge at least):
  • Helping pass through a more sensible NUMA topology to improve performance. This requires the NUMA option to be set as well.
  • Fulfilling software requirements that check the number of sockets. Some software expects a certain number of sockets to be present (often for licensing reasons), specifying the correct number of sockets can help here.
So unless you intend to pass through your host's NUMA topology or software in the guest requires it, you can stick with one socket in most cases.

Hope that helps clear this up, if it did, please edit the thread and mark it as "[SOLVED]". Thanks.
 

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!