Have you ever noticed that some servers are faster, even if they have identical hardware? A primary contributor to this could be NUMA, or Non-Uniform Memory Access. Don't be frightened, the term isn't as intimidating as it seems. Let's start with an easy explanation.
This can be likened to you grabbing a bite to eat out of your own fridge, which is quick, or traveling to your neighbor's house to grab a bite, which takes more time than just going to your fridge. In NUMA architecture, this is what is meant by local memory and remote memory.
NUMA addresses this concern by allocating each CPU a dedicated memory to utilize first. This is similar to assigning each chef in the kitchen their own mini fridge so they don't have to fight for space. It speeds things up and compartmentalizes things.
If your application is primarily accessing memory local to its CPU, it will perform extremely well. But if it is requesting memory - a remote access request for. - slow way; depending on the use of memory.
Here is the foremost simplified definition:
What Is NUMA?
Imagine a computer with more than one CPU (central processing unit). Each CPU has a piece of memory allocated to it. In a NUMA system, the CPU can access memory from its own memory area very quickly, but if it has to access memory from a different CPU's memory area, it takes longer to access that memory.This can be likened to you grabbing a bite to eat out of your own fridge, which is quick, or traveling to your neighbor's house to grab a bite, which takes more time than just going to your fridge. In NUMA architecture, this is what is meant by local memory and remote memory.
Why NUMA Was Developed
You may be asking — If NUMA is referred to as Non-Uniform memory Access, why would one not just have all CPUs access one large chunk of memory? This is precisely how old systems used to work, and was referred to as SMP (Symmetric Multiprocessing). When too many CPUs access the one chunk of memory, things become messy, slow, and really difficult to manage.NUMA addresses this concern by allocating each CPU a dedicated memory to utilize first. This is similar to assigning each chef in the kitchen their own mini fridge so they don't have to fight for space. It speeds things up and compartmentalizes things.
How NUMA Affects Performance
NUMA can speed things up — or slow things down— depending on the workload.If your application is primarily accessing memory local to its CPU, it will perform extremely well. But if it is requesting memory - a remote access request for. - slow way; depending on the use of memory.
Here is the foremost simplified definition:
- Local - Fast.
- Remote - Slower.
- NUMA-aware software knows how to access memory in a more advantageous way to achieve speed up.
How to Improve NUMA Performance
If you're running virtual machines or heavy workloads, here are three simple ways to enhance NUMA performance:- Pin your VMs or applications to a single CPU, so it will stay close to its memory.
- Enable NUMA balancing in your operating system, if supported.
- Run numactl, or lscpu, among other tools, to see how your system is using memory.