K10 — NUMA Systems: Memory Nodes and Local Allocation
Key Insight: On multi-socket servers, “local memory” and “remote memory” access latency can differ by up to 3x — NUMA is the source of this difference.
The Concept of NUMA
NUMA (Non-Uniform Memory Access) means each CPU core has local memory. Local access is fast, remote access is slow.
2-socket example:
CPU 0 → Local: 60ns, Remote: 100ns
CPU 1 → Local: 60ns, Remote: 100nsNUMA-Aware Allocation
Linux supports three NUMA policies:
- First Touch (default): allocate on the accessing node
- Interleaved: round-robin across nodes
- Membind: force allocation to specific nodes
$ numactl --localalloc ./program
$ numactl --interleave=all ./program
$ numactl --membind=0 ./programSummary
NUMA is critical for multi-socket performance. Use numastat to monitor cross-node access.
Comments