NUMA Topology & Memory Policy

NUMA architecture, memory node locality, numactl policies, and NUMA-aware tuning for latency-sensitive workloads.

Overview

NUMA (Non-Uniform Memory Access) is the memory architecture of modern multi-socket servers. Each processor socket has local RAM — access to local memory is ~60ns, access to RAM on another socket (via QPI/UPI interconnect) is ~120ns or higher.

Why NUMA Matters

A process pinned to CPU 0 that allocates memory on NUMA node 1 incurs remote memory latency on every access. At scale, this causes throughput degradation and latency spikes invisible to top/htop.

Memory Allocation Policies

  • local (default) — Allocate from the node where the requesting CPU runs
  • preferred — Prefer node N, fall back to others if full
  • bind — Allocate only from node N — fail if insufficient
  • interleave — Round-robin across nodes — maximizes bandwidth

Kubernetes and NUMA

Kubernetes Topology Manager (--topology-manager-policy=single-numa-node) ensures CPU and memory allocations for Guaranteed QoS pods are colocated on a single NUMA node, critical for latency-sensitive HPC and telco workloads. Check with:

Key concepts

NUMA node
A group of CPUs and their directly attached memory. Access to local memory is ~2x faster than remote (cross-socket via QPI/UPI) memory.
numastat
Shows per-node memory allocations and NUMA miss counters. High numa_foreign or other_node counts indicate remote memory access.
Topology Manager
Kubernetes component that aligns CPU, memory, and device (RDMA/GPU) allocations to a single NUMA node for Guaranteed QoS pods.
Interleave policy
Distributes memory pages round-robin across NUMA nodes. Trades locality for aggregate bandwidth — good for large working sets that exceed one node.

When to use it

  • Diagnosing unexpected latency on a multi-socket server despite low overall CPU/memory usage
  • Tuning database servers (Redis, PostgreSQL, MySQL) for maximum memory throughput
  • Explaining Kubernetes Topology Manager for latency-sensitive Guaranteed pods

Interview questions

  • A Redis instance on a 2-socket server shows unexpectedly high latency at moderate load. How does NUMA factor in and how do you diagnose?

Sign up free to read the full topic

More Linux topics

Start free on Cariara · Coding problems · System design studio