concept Hosting
NUMA locality and hosting workload placement
On a multi-socket server, the same worker can make both local and remote memory accesses. Compare a fixed set of reads to see how placement and the assumed cost of each path affect the total.
What it means
NUMA (non-uniform memory access) means that the cost of reaching memory can depend on where a thread runs relative to the data it uses. Consider a two-socket server with one NUMA node per socket. For a web worker running on node A, a read from A’s memory is local; a read from B’s memory takes a remote path. The same data on B would be local to a worker running on B. Core count alone doesn’t tell you which path a read takes.
Try it
Simulation: Start with 100 memory accesses, of which 30 are remote. With the scenario evidence set to provided, each local access costs 100 synthetic nanoseconds (ns) and each remote access costs 180 synthetic ns. That leaves 70 local accesses, for a total cost of 70 × 100 + 30 × 180 = 12,400 synthetic ns.
NUMA locality and hosting workload placement
Explain remote-memory penalties in multi-socket hosting environments
Weighted modeled access cost depends on placement and stipulated latency, not CPU count alone.
Memory placement
- Worker on node A100 accesses
- Local node A70 × 100 ns
- Remote node B30 × 180 ns
Both paths belong to the same workload. The total is a synthetic serial sum, not measured hardware latency.
Evaluated inputs
- Required scenario evidence
- provided
- Remote accesses
- 30 count
- Memory accesses
- 100 count
- Local cost
- 100 synthetic ns
- Remote cost
- 180 synthetic ns
Serial sum of stipulated access costs, no overlap, cache hits, bandwidth contention or hardware benchmark.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
Change only Remote accesses from 30 to 0. Keep Memory accesses at 100: the remote reads are part of the workload, not extra work on top of it. All 100 accesses now use the local cost, so the total is 100 × 100 = 10,000 synthetic ns. Reset restores the original counts, costs and evidence setting.
Zero is different from unknown. If you set Required scenario evidence to missing, the simulation gives no cost, even if numbers are still selected. With evidence provided, a remote count larger than the total is invalid, not an especially expensive placement.
Where the extra 2,400 comes from
In the starting example, the 30 remote reads contribute 5,400 synthetic ns to the total. But 5,400 is not the remote penalty: those same reads would still cost 3,000 synthetic ns if local. The difference is 30 × (180 − 100) = 2,400 synthetic ns. The comparison changes the path for 30 reads without removing any of them.
The bars separate the local contribution, the remote contribution and their sum. Compare the sum with the all-local reference for the same number of reads. Do not add the reference bar to the sum: it is a counterfactual baseline, not extra memory work.
This distinction separates placement from price. If both paths are assigned a cost of 100 synthetic ns, the original mix still has 30 remote accesses, but its total is now the same as the all-local total. The count tells you how often the remote path is used; the assumed difference in cost tells you what that means for the sum.
In practice
Suppose a hosting workload repeatedly reads a lookup table. Before recommending CPU affinity, find out where the worker ran and where the pages it read were located during the same workload. Knowing that the worker stayed on node A answers only the first question. It doesn’t establish that the table was on A, or how many reads went to B.
The simulation adds access costs one after another. It doesn’t model overlapping accesses, cache hits or competition for memory bandwidth. Its total is neither a bandwidth measurement nor a prediction of how long a web request will take. Use execution and memory placement together to identify a possible locality cost; then measure the workload on the actual host before attributing a slowdown to that cost.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Does NUMA imply remote is always slower?
No universal latency ordering is established by the label. The example stipulates two path costs; if they are equal, the sum is unchanged even with remote accesses. Actual performance depends on hardware, caching, contention and workload.
Is NUMA the same as core count?
No. NUMA describes memory-access topology and placement, not merely the number of execution cores. Two systems with the same core count may have different locality.
Does CPU affinity alone guarantee locality?
No. Scheduling a thread on a node does not guarantee its data was allocated on that node. Allocation policy and actual memory location matter too.
Can migration change locality?
Yes. Linux can relocate pages to another NUMA node while preserving their virtual addresses. If the location of execution stays the same, this can change the locality of memory accesses. The lab changes stipulated counts, not real placement.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Linux NUMA memory policy
NUMA memory policy. NUMA memory policy affects allocation node selection; actual locality also depends on workload and scheduling.
Checked .
- Linux page migration
Page migration: introduction. Linux can move physical pages to another NUMA node while preserving virtual addresses. This can change memory locality without changing pointer identity.
Checked .