Number of NUMA nodes and CPU core selection for low latency systems

Abstract: Resolve unpredictable latency spikes in low latency Linux systems by aligning CPU affinity with NUMA topology and disabling hyperthreading.

Created: 2026-09-12 by
To optimize low latency systems on Linux, you must align your application’s CPU affinity with the physical Non-Uniform Memory Access (NUMA) topology. By binding threads to specific cores within a single NUMA node and disabling hyperthreading where appropriate, you eliminate cross-node memory traffic and cache thrashing, which are primary causes of unpredictable latency spikes in high-performance computing environments.

Understanding NUMA Topology

Non-Uniform Memory Access (NUMA) architectures divide the system into nodes, each containing one or more CPUs and their local memory controllers. In a NUMA system, accessing memory attached to a local CPU is significantly faster than accessing memory attached to a remote CPU. For low latency applications, such as high-frequency trading engines or real-time data processing pipelines, this difference in access time can be critical. You can inspect the NUMA topology using the numactl --hardware command. This output reveals how many nodes exist, how many CPUs belong to each node, and the memory distribution. Understanding this layout is the first step in designing an efficient core allocation strategy. If your application spans multiple NUMA nodes, it may suffer from increased latency due to inter-node communication overhead. Therefore, the goal is often to confine the application's workload to a single NUMA node whenever possible.

Selecting the Right CPU Cores

Once you understand the topology, you need to select the optimal set of CPU cores for your application. The selection process involves balancing between physical cores and logical processors (hyperthreads). Hyperthreading allows a single physical core to execute two threads simultaneously by duplicating certain parts of the CPU. While this increases throughput for general-purpose workloads, it can introduce jitter and latency variability for latency-sensitive tasks because both threads compete for the same execution resources. For strict low-latency requirements, it is often recommended to disable hyperthreading or to bind threads to physical cores only. You can identify physical cores versus logical threads by examining the CPU information in /proc/cpuinfo or using tools like lscpu. Look for the core id and cpu cores fields. Physical cores share the same core id, while logical threads have unique IDs but share the same core ID. Binding to unique core IDs ensures that your threads do not compete for execution units on the same physical core. Additionally, consider the relationship between CPU caches and NUMA nodes. L3 caches are often shared among cores within a NUMA node. Keeping related threads close to each other within the same node maximizes cache locality, further reducing latency. This is particularly important for applications with heavy data sharing between threads.

Implementing CPU Affinity and Memory Policies

The Linux kernel provides mechanisms to enforce CPU affinity and memory policies. The numactl utility is essential for launching processes with specific NUMA preferences. Using numactl --cpunodebind, you can restrict a process to run only on CPUs belonging to a specific NUMA node. Similarly, --membind ensures that memory allocations come from the local node’s memory banks. For finer control, you can use the SCHED_SETAFFINITY system call within your application code to pin individual threads to specific CPU masks. This is useful when different threads have different latency requirements or computational characteristics. For example, a thread handling network I/O might be pinned to a different core than a thread performing complex calculations, allowing them to operate independently without interference. It is also crucial to configure the kernel scheduler correctly. You may want to isolate cores from the general scheduler using the isolcpus boot parameter. This prevents the kernel from scheduling background tasks, such as interrupts or daemon processes, on the cores reserved for your low-latency application. This isolation reduces context switches and interrupt-induced latency spikes. Note that managing isolated cores requires careful configuration to ensure that necessary system services still have access to available CPUs. For more details on kernel task isolation, see our guide on Ubuntu Kernel Sending Task to Isolated Core.

Monitoring and Validation

After configuring your system, validate the performance gains using monitoring tools. Tools like perf, htop, and numastat provide insights into CPU usage, cache misses, and memory access patterns. Specifically, look for a reduction in remote memory accesses and cache miss rates after implementing NUMA binding. A successful configuration should show that most memory accesses are local to the NUMA node hosting the executing thread. If you observe unexpected latency spikes, check for interrupt migration. Interrupts can be migrated between CPUs, potentially moving away from the isolated cores. Use irqbalance or manually configure IRQ affinities to keep interrupts on the isolated cores if they are part of your workload, or off them entirely if they cause contention. Additionally, ensure that power management settings do not downclock the CPUs unexpectedly. Power saving states can introduce latency during frequency transitions. You may need to set the CPU governor to performance using cpupower or similar tools. Be aware that power settings can vary based on user privileges; for instance, checking why cpupower reports different speeds and settings depending on if I'm root is a common troubleshooting step when power management behaves inconsistently.

Frequently Asked Questions

How do I check my current NUMA topology?

Run numactl --hardware in the terminal to display the available NUMA nodes, their associated CPUs, and memory ranges. This output helps you map out which cores are physically close to each other and share memory bandwidth.

Is hyperthreading always bad for low latency?

Not always, but it often introduces jitter. Hyperthreading shares execution resources, which can lead to unpredictable delays if two threads contend for the same functional units. For deterministic low latency, disabling it or strictly binding to physical cores is usually safer.

What does isolcpus do exactly?

The isolcpus kernel parameter removes specified CPUs from the default scheduler domain. This prevents the OS from scheduling non-real-time tasks on those cores, reducing noise and context switches for your dedicated low-latency threads.

Can I change NUMA bindings at runtime?

Yes, you can use taskset to modify CPU affinity for running processes or implement SCHED_SETAFFINITY calls within your application. However, changing memory policies dynamically is more complex and may require restarting the application or using advanced memory management APIs.

Why are my latency spikes still occurring despite proper binding?

Check for interrupt handling overhead. If hardware interrupts are being handled on the same cores as your application, they can cause significant latency. Consider migrating IRQs to different cores or using dedicated interrupt handling threads to decouple them from your critical path.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More