numastat

Display NUMA memory allocation statistics per node.

Category: Performance NUMA memory diagnostics statistics

Install

# RHEL / Alma / Rocky
sudo dnf install numactl

# Debian / Ubuntu
sudo apt install numactl

# openSUSE
sudo zypper install numactl

# Arch
sudo pacman -S numactl

What it does

numastat displays memory usage statistics for each NUMA node. It helps diagnose memory imbalance and cross-node allocations.

How it works (mechanical)

  • Reads kernel NUMA memory counters.
  • Reports per-node allocation and page statistics.
  • Helps identify remote memory access.
  • Useful for tuning NUMA-aware applications.
  • Often paired with numactl.

Quick Start

# Show NUMA statistics
numastat

10 Practical Examples

# 1) Basic NUMA statistics
numastat
# 2) Monitor live
watch -n 1 numastat
# 3) Check memory imbalance
numastat | column -t
# 4) Run workload and inspect NUMA distribution
numactl --cpunodebind=0 --membind=0 ./app
numastat
# 5) Identify remote memory usage
numastat | grep -i numa_miss
# 6) Compare before/after performance tuning
numastat
# 7) Correlate with hardware layout
numactl --hardware
# 8) Check specific node memory allocation
numastat -m
# 9) View system memory overview
free -h
# 10) Combine with htop for analysis
htop

Notes & Gotchas

  • Only meaningful on NUMA systems.
  • Remote memory access can reduce performance.
  • Use with numactl for tuning.
  • Cross-node memory allocation often indicates imbalance.
  • Database and HPC workloads benefit most from analysis.

Historical Context

As multi-socket systems became common, Linux added NUMA support. numastat provides visibility into memory locality.

Modern Equivalent

Modern orchestration tools may auto-manage NUMA, but manual inspection with numastat remains critical for performance tuning.

Related Commands

  • numactl — control NUMA policy.
  • cpupower — manage CPU frequency.
  • lscpu — show CPU topology.
  • free — display memory usage.
  • htop — monitor CPU and memory usage.