NUMA – Get Current Configuration ( On Linux )

Background

Reading through database documentation and understanding that some database platforms do not really support NUMA, as well as others.

What is NUMA?

Wikipedia

Link

Modern CPUs operate considerably faster than the main memory they use.

CPUs increasingly have found themselves “starved for data” and having to stall while waiting for data to arrive from memory.

Many supercomputer designs of the 1980s and 1990s focused on providing high-speed memory access as opposed to faster processors, allowing the computers to work on large data sets at speeds other systems could not approach.

Limiting the number of memory accesses provided the key to extracting high performance from a modern computer.

For commodity processors, this meant installing an ever-increasing amount of high-speed cache memory and using increasingly sophisticated algorithms to avoid cache misses.

But the dramatic increase in size of the operating systems and of the applications run on them has generally overwhelmed these cache-processing improvements. Multi-processor systems without NUMA make the problem considerably worse. Now a system can starve several processors at the same time, notably because only one processor can access the computer’s memory at a time.

NUMA attempts to address this problem by providing separate memory for each processor, avoiding the performance hit when several processors attempt to address the same memory.

For problems involving spread data (common for servers and similar applications), NUMA can improve the performance over a single shared memory by a factor of roughly the number of processors (or separate memory banks).

Of course, not all data ends up confined to a single task, which means that more than one processor may require the same data. To handle these cases, NUMA systems include additional hardware or software to move data between memory banks.

This operation slows the processors attached to those banks, so the overall speed increase due to NUMA depends heavily on the nature of the running tasks.

Linux

Review Configuration

Processor Name

Get Processor Name

/proc/cpuinfo

Code

cat /proc/cpuinfo | grep -i "model name" | sort | uniq

Output

processorName.01.20190804.0538PM

Processors / CPU

Get Number of CPUs and Cores

Number of Cores

/proc/cpuinfo
Code

cat /proc/cpuinfo | grep -c 'core'

Output

core.01.20190804.0456PM

Number of processors

/proc/cpuinfo
Number of processors
Code

cat /proc/cpuinfo | grep -c 'processor'

Output

processor.01.20190804.0438PM.PNG

 

Number of Sockets

lscpu
Number of sockets
Code

lscpu | grep -i 'socket'

Output

socket.01.20190804.0448PM

NUMA Grouping

Get CPU NUMA grouping

lscpu

Code

lscpu | grep -i 'NUMA'
Output

numa.lscpu.01.20190804.0501PM

Explanation
  1. Here we have a lone NUMA Group
  2. All six (6) CPUs are within the lone grouping

 

numactl

Code

numactl -- hardware
Output

numactl.hardware.01.20190804.0550PM

Explanation
  1. Single NUMA Node
    • CPUs => 0,1,2,3,4,5
    • Size => 132 GB
    • free => 600 MB

 

References

  1. James Green
    • Sockets vs. Cores on a VMware VM Config?
      Link
  2. Indiana University
    • About processors, chips, sockets, and cores
      Link
  3. Stack Overflow
    • How to obtain the number of CPUs/cores in Linux from the command line?
      Link
  4. FibreVillage
    • How to tell if CPU hyperthreading enabled on Linux
      Link

One thought on “NUMA – Get Current Configuration ( On Linux )

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s