TRT
Sign in

Advanced · Module 9 · Lesson 7 of 13

NUMA Architecture, Memory Interconnects, and CPU Pinning

Architect NUMA-aware multi-threaded systems, manage local vs. remote memory interconnect latency, configure memory allocation policies with libnuma, and bind execution threads with pthread_setaffinity_np.

Pro — members onlyAbout 16 minutes

By the end you can

  • Differentiate Uniform Memory Access (UMA) from Non-Uniform Memory Access (NUMA) topologies
  • Trace cross-socket interconnect penalties across Intel UPI and AMD Infinity Fabric
  • Diagnose the Linux kernel first-touch allocation policy and eliminate remote memory access bottlenecks
  • Pin worker threads to dedicated CPU cores using pthread_setaffinity_np and CPU_SET

Builds on Cache-Conscious Data Structures: Alignment, False Sharing, and Structure of Arrays.

01 · A question first

Why does a multi-threaded C service run at 10 million operations per second on a single-socket workstation, yet drop to 4 million operations per second on an enterprise dual-socket server with twice as many cores? The answer lies in NUMA node boundaries and cross-socket memory interconnect penalties.

Make a guess before you read on.

02 · The idea

Members only

Unlock the full lesson

This lesson is part of the membership. Join to read it in full, along with every other premium deep dive.

What's inside

  • Start with the problem
  • How the idea works
  • Production Implementation: NUMA-Aware Worker Pool
  • The libnuma Memory Allocation Policies
  • Why it is correct
  • What it costs
  • Pitfalls and variations
  • Where it is used

03 · Practice

Something wrong with this lesson? Report a problem