Plan memory allocation across NUMA nodes to minimize remote memory access latency.
On multi-socket (NUMA — Non-Uniform Memory Access) systems, each CPU socket has its own locally-attached memory; accessing memory attached to a different socket ('remote' access) crosses an inter-socket interconnect and costs additional latency, typically 50-100ns on top of local access latency. The local access ratio — measurable via `numastat` or perf's NUMA events — directly determines average effective memory latency; tools like numactl let you bind a process's memory allocations and CPU execution to the same node to maximize this ratio.
Average memory latency
avg_latency = local_ratio × local_latency + remote_ratio × (local_latency + remote_penalty)
`numastat -p <pid>` shows a process's memory allocation split across NUMA nodes, and `numastat` alone shows system-wide hit/miss statistics (numa_hit vs numa_miss/numa_foreign) that indicate how often memory ended up on a different node than where it was allocated from.
`numactl --cpunodebind=0 --membind=0 <command>` pins both CPU execution and memory allocation to NUMA node 0, ensuring the process's memory accesses stay local. For already-running processes, `numactl` alone can't rebind, but taskset combined with careful memory migration tools can help.
Largely no for cross-socket effects, but some modern single-socket CPUs still expose multiple NUMA nodes internally (e.g. AMD's chiplet designs can present each CCX or CCD as a separate NUMA node), so it's worth checking `numactl --hardware` even on nominally single-socket servers.