Articles in this section

How to disable Automatic NUMA Balancing on RHEL 9?

Context

Overview:

Automatic NUMA Balancing is a kernel feature that periodically moves tasks closer to the memory they are accessing and migrates memory pages to nodes local to the tasks. While beneficial for general workloads, it can cause latency spikes in high-performance computing (HPC), large databases, or real-time applications.

 

Method

1. Quick Check

Before making changes, verify the current status of NUMA balancing.
 
  • Command: sysctl kernel.numa_balancing
  • Values: 1 (Enabled), 0 (Disabled)

2. Implementation Methods

Method A: Runtime (Temporary)

Use this for testing or immediate effect. Settings will be lost after a reboot.
# Using sysctl
sudo sysctl -w kernel.numa_balancing=0

# OR using the proc filesystem
echo 0 | sudo tee /proc/sys/kernel/numa_balancing

Method B: Persistent (Recommended)

Use this to ensure the setting survives a system reboot. This is the standard approach for production servers.
 
  1. Create a config file:
    sudo vi /etc/sysctl.d/99-disable-numa.conf
    
  2. Add the following line:
    kernel.numa_balancing = 0
    
  3. Apply changes:
    sudo sysctl -p /etc/sysctl.d/99-disable-numa.conf
    

Method C: Kernel Boot Parameter

This disables the feature at the earliest possible stage of the boot process.
 
  1. Edit GRUB: Update /etc/default/grub and append numa_balancing=disable to the GRUB_CMDLINE_LINUX variable.
  2. Rebuild GRUB config:
    # For BIOS/UEFI on RHEL 9
    sudo grubby --update-kernel=ALL --args="numa_balancing=disable"
    

3. Verification & Troubleshooting

To confirm the change has been applied successfully, use the following tools:
ToolCommandExpected Result
sysctlsysctl kernel.numa_balancing0
numastatnumastat -nMonitor for reduced "interleave" hits
dmesg`dmesggrep -i numa`

4. When to Disable

 
  • Low Latency Requirements: When micro-stutters from page migration are unacceptable.
  • Static Pinning: If you are already manually pinning CPUs and memory using numactl or cpusets.
  • Specific Database Recommendations: When vendor documentation explicitly requires it.
 
 
 
 

Applies To Earliest Version

6.0

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful