This is how memory in multi-processor servers is arranged: each socket has its own memory, and the other one is reachable over the inter-processor bus and is slower. The server is divided into NUMA nodes, and applications are pinned to one of them.
What a NUMA node looks like
Reading from memory next to your own processor and reading through the bus from somebody else’s take different amounts of time — hence the name: access is non-uniform. Without binding to a node a thread may end up on one socket while its data sits on another, and every operation then crosses the inter-processor link.
A NUMA node is a processor together with the memory attached to it and its own PCIe lanes, which network cards and storage drives are usually hung off. The opposite arrangement, where one memory is equally available to all processors, is called UMA (uniform memory access) — that is how early multi-processor machines worked and how a single socket is arranged. Traffic between nodes travels over a processor-to-processor link: Intel calls it UPI, AMD calls it Infinity Fabric. Describing the nodes for the Linux kernel is ACPI’s job: the SRAT and SLIT tables list which processor belongs to which memory and what the relative cost of access between nodes is.
| Term | What it means |
|---|---|
| UMA | one memory pool for all processors, access takes the same time |
| NUMA node | a socket with its own memory and its own set of PCIe lanes |
| Local memory | memory inside the processor’s node, the fastest path |
| Remote memory | memory of a neighbouring node, reached over the inter-processor bus |
What the system shows and how to pin a process
The number of nodes and the layout of cores are shown by lscpu; the full report is numactl --hardware:
NUMA node(s): 2NUMA node0 CPU(s): 0-31,64-95NUMA node1 CPU(s): 32-63,96-127available: 2 nodes (0-1)node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 32 33 34 35 36 37 38 39node 0 size: 257000 MBnode 1 size: 262000 MBTo run a process on a specific node with the memory of that same node, use the same numactl:
numactl --cpunodebind=0 --membind=0 ./appWithout binding the kernel tries to allocate memory where the process started, but does not guarantee it: memory runs out, threads migrate between cores. For databases and caches memory is often split evenly between nodes — numactl --interleave=all — so that broken locality hurts less. The Linux kernel can also adapt on its own: numa balancing migrates memory pages to the processes that read them most often.
When the difference is noticeable
- databases and data stores such as PostgreSQL and Redis: the amount of memory approaches node boundaries, and random placement costs percentage points of performance
- AI training and inference: each GPU is attached to its own socket, and pinning a training process to the nearest node removes extra traffic between sockets;
nvidia-smi topo -mshows the GPU matrix and the binding to NUMA nodes - HPC and MPI programs: ranks are pinned to the cores of a single node
- virtualisation: the vCPUs of a virtual machine are kept within a single node where possible
On a single socket or a desktop machine almost none of this is noticeable: there is effectively one node, and there is simply nothing to tell apart.
Sources
the term is written from these pagesVerified 9 Nov