8.2. Automatic NUMA Balancing

Automatic NUMA balancing improves the performance of applications running on NUMA hardware systems. It is enabled by default on Red Hat Enterprise Linux 7 systems.
An application will generally perform best when the threads of its processes are accessing memory on the same NUMA node as the threads are scheduled. Automatic NUMA balancing moves tasks (which can be threads or processes) closer to the memory they are accessing. It also moves application data to memory closer to the tasks that reference it. This is all done automatically by the kernel when automatic NUMA balancing is active.
Automatic NUMA balancing uses a number of algorithms and data structures, which are only active and allocated if automatic NUMA balancing is active on the system:
  • Periodic NUMA unmapping of process memory
  • NUMA hinting fault
  • Migrate-on-Fault (MoF) - moves memory to where the program using it runs
  • task_numa_placement - moves running programs closer to their memory

8.2.1. Configuring Automatic NUMA Balancing

Automatic NUMA balancing is enabled by default in Red Hat Enterprise Linux 7, and will automatically activate when booted on hardware with NUMA properties.
Automatic NUMA balancing is enabled when both of the following conditions are met:
  • # numactl --hardware shows multiple nodes, and
  • # cat /sys/kernel/debug/sched_features shows NUMA in the flags.
Manual NUMA tuning of applications will override automatic NUMA balancing, disabling periodic unmapping of memory, NUMA faults, migration, and automatic NUMA placement of those applications.
In some cases, system-wide manual NUMA tuning is preferred.
To disable automatic NUMA balancing, use the following command:
# echo 0 > /proc/sys/kernel/numa_balancing
To enable automatic NUMA balancing, use the following command:
# echo 1 > /proc/sys/kernel/numa_balancing