Home

numactl

Numactl is a command-line utility and library for controlling NUMA (non-uniform memory access) policies on NUMA-enabled Linux systems. It allows users to run a program with a specified CPU affinity and memory allocation policy, enabling control over where code executes and where memory is allocated. This can improve performance on systems where memory access time depends on the memory node location.

The tool supports several policies and options for binding CPUs and memory to specific NUMA nodes, or

In practice, numactl is used to optimize NUMA locality for compute-intensive workloads, databases, and large-scale data

The tool is distributed as part of the numactl package on many Linux distributions and is widely

for
distributing
allocations
across
nodes.
Common
options
include
--cpunodebind=nodes
to
bind
CPUs
to
certain
NUMA
nodes,
--membind=nodes
to
constrain
memory
allocations
to
particular
nodes,
and
--physcpubind=cpus
to
assign
physical
CPUs.
The
--interleave=nodes
option
interleaves
memory
allocations
across
the
listed
nodes,
while
--preferred=nodes
expresses
a
preferred
set
of
nodes
for
allocations.
The
--localalloc
flag
requests
allocations
from
the
local
node
first.
Commands
can
be
started
with
these
policies,
and
the
current
policy
or
topology
can
be
inspected
with
--show
or
--hardware.
processing,
by
reducing
remote
memory
accesses
and
improving
cache
efficiency.
It
is
frequently
employed
in
performance
tuning
and
benchmarking
on
NUMA
architectures.
The
accompanying
libnuma
library
exposes
a
programming
interface
for
C
programs
to
query
and
set
NUMA
policies,
enabling
policy
control
from
within
applications.
used
in
environments
that
require
explicit
NUMA
management.