Observation and diagnostics · Intermediate

Inspecting NUMA placement with numastat

Read per-node placement and allocation statistics while distinguishing them from CPU execution location and actual memory accesses.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Separate memory placement from access locality
  2. Inspect allocation by node
  3. Numa_miss is not a remote-load counter
  4. Compare memory with CPU placement
  5. Ask Logeia about this articleCheck your understanding

Separate memory placement from access locality

On NUMA systems, the processor and memory-node combination can affect access cost and available bandwidth. Numastat provides views of per-node memory placement and allocation behavior, helping investigate whether memory landed where an application intended. Placement and access are different facts: knowing where pages reside does not directly reveal which CPUs read them or how frequently. A large amount allocated on node zero is therefore not, by itself, proof of performance loss from remote memory access. Relate placement to the workload’s actual execution and data-use pattern.

Inspect allocation by node

Numastat -p 1234 illustrates inspecting memory placement for a selected process. Replace the PID and establish the node-to-CPU topology, for example with numactl --hardware. First-touch allocation, memory policy, prior placement and page migration can all affect the result. A program that initializes on one node and later executes workers elsewhere may create a mismatch worth investigating. No numerical result is invented here, and node numbers are identifiers rather than a ranking of how fast memory is. Verify what the installed tool reports and which units its selected mode uses.

sh
numactl --hardware
numastat -p 1234

Numa_miss is not a remote-load counter

Default counters such as numa_hit and numa_miss describe aspects of memory allocation and whether allocation followed the intended node. Do not relabel numa_miss as the number of remote load instructions executed by the CPU. Also distinguish cumulative page-related counters from the memory-amount report produced for a process with -p. To investigate a current event, compare changes over a matched interval with CPU affinity, migrations and execution time. A large lifetime counter may mostly describe earlier activity and can be irrelevant to the process currently experiencing latency.

Compare memory with CPU placement

Potential changes include aligning CPU and memory placement, distributing initialization across the workers that will use the pages, or considering interleaving for an appropriate workload. Binding can create capacity or bandwidth imbalance, and automatic NUMA balancing may interact with manual policy. Effects depend on working-set size and access pattern rather than on a universal preference for one node. Combine placement data with application performance and suitable access-level observations. Declare success only after a controlled comparison improves the intended metric without introducing a new memory-capacity or scheduling bottleneck elsewhere in the system.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Build your CS foundations · STEP 8

Understand the systems behind the web · STEP 6

Prepare for AI systems · STEP 5

Choose a learning path