NUMA and sub-NUMA settings in firmware
Video 097 of 140 in Virtualization Foundations, in the unit “Firmware settings that matter on a virtualization host”. 3:07, with English and Hindi audio.
A large server can have more than one processor socket, and each socket has its own memory attached to it. Firmware can change how that memory is shown to Linux, and that choice affects how quickly a virtual machine reaches its memory. This article explains NUMA, how the interleaving and sub-NUMA settings change what Linux sees, how to size a virtual machine against the nodes, and how to check the nodes with lscpu.
What you will learn
- NUMA means memory close to a processor is faster to reach than memory on another socket.
- Interleaving hides the memory layout, and it slows reads that cross sockets.
- Sub-NUMA clustering splits each socket into smaller nodes that Linux sees separately.
- Size a virtual machine to fit inside one node wherever you can.
- On a two-socket host, if lscpu shows only one NUMA node, check the firmware setting.
What NUMA means, and the names firmware uses
NUMA stands for non-uniform memory access. Memory close to a processor is faster to reach than memory on another socket. Firmware can split the memory into nodes, and each node is a block of processors and memory that sit close together.
- Intel calls the finer split Sub-NUMA Clustering.
- AMD calls the same kind of setting NPS, which stands for nodes per socket.
Near memory against far memory
Inside one socket, memory sits close to the cores. A virtual machine that stays on one socket reaches its memory quickly. If the setting interleaves memory across both sockets, Linux can no longer tell which memory is near, and some reads cross the link between the sockets.
Those reads are slower, so a database waits longer for each answer. Sub-NUMA clustering works the other way. It splits each socket into smaller nodes, so Linux sees more of them, each with its own memory.
Sizing a virtual machine against the nodes
At Harbor Point, the PROD-A hosts have two sockets with twenty-four cores each, and 768 GB of memory in total. A database virtual machine with 24 vCPUs and 256 GB fits in one socket, if memory is spread evenly, because each socket holds about 384 GB.
A virtual machine bigger than one node spans two nodes. Part of its memory is then far away, and that slows it down. The right layout depends on the virtual machine sizes you run, so check the setting against the largest virtual machine on each host.
Check the nodes in Linux
The lscpu command lists the sockets, and the NUMA nodes that Linux has built from them. Each node line lists its processors.
lscpu | grep -E 'Socket|NUMA'Note: The CPU ranges in the output depend on the host, so read the node count first. On a two-socket host, one NUMA node means the firmware setting needs a look.
Terms
- NUMA node
- A block of processors and memory that sit close together, so they reach their own memory faster than memory on another socket.
- Interleaving
- A firmware setting that spreads memory across sockets, so Linux can no longer tell which memory is near.
Check yourself
What is the effect of interleaving memory across sockets?
Linux can no longer tell which memory is near, and some reads cross the link between sockets, which is slower.
What happens to a virtual machine that is bigger than one NUMA node?
It spans two nodes, so part of its memory is far away, and that slows it down.
What should you check when lscpu shows one NUMA node on a two-socket host?
The firmware setting, because the sockets may not be shown as separate nodes.
Previous: Power profiles, C-states and P-states. Next: UEFI boot mode and Secure Boot on a host.