NUMA Architecture Detailed

Source: Internet
Author: User

1. Several concepts of NUMA (Node,socket,core,thread)

For Socket,core and thread will have a lot of article introduction, here briefly, specifically see:

Summary: Socket is the CPU socket on the motherboard; Core is a separate set of program execution hardware units in the socket, such as registers, calculation units, etc. Thread: Is the concept of Hyper-threading Hyperthread, the execution unit of logic, the independent execution context, but the sharing of registers and compute units within the core.

The concept of node is more in NUMA architecture, which is actually used to solve the problem of core grouping, see Understanding (the OS CPU in the figure can understand thread, then the core is not drawn in the diagram), you can see that each socket has two node, A total of 4 sockets, each socket 2 node, each node has 8 thread, a total of 4 (socket) x2 (Node) x8 (4corex2 thread) = 64 thread.

In addition each node has its own internal CPU, bus and memory, but also can access other node memory, NUMA's biggest advantage is that it can easily increase the number of CPUs, because node has its own internal bus, so the increase in the number of CPUs can be achieved by increasing the number of node, If you simply increase the number of CPUs, the bus will cause great pressure, so the UMA structure can not support a lot of cores.

"This figure is from: NUMA best Practices for Dell PowerEdge 12th Generation Servers"

As mentioned above, because each node has its own CPU bus and memory, if the Vcpus of a virtual machine across different node, it will cause a CPU in node to access the memory in another node, which leads to increased memory access latency. In some special scenarios, such as in an NFV environment, where performance requirements are high, it is very important that the vcpus of the same virtual machine are allocated to the same node as PCPU, so that the features of the NUMA-aware virtual Machine Scheduler are added in the kilo version of OpenStack.

2. How to view the NUMA topology of a machine

The more commonly used command is LSCPU, the specific output is as follows:

  1. dylan@hp3000:~$ LSCPU
  2. Architecture:x86_64
  3. CPU Op-mode (s): 32-bit, 64-bit
  4. Byte Order:little Endian
  5. CPU (s): 48//Total 48 logical CPUs (threads)
  6. On-line CPU (s) list:0-47
  7. Thread (s) per Core:2//2 x threads per core
  8. Core (s) per socket:6//socket with 6 x cores
  9. Socket (s): 4//A total of 4 sockets
  10. NUMA node (s): 4//A total of 4 NUMA nodes
  11. Vendor Id:genuineintel
  12. CPU Family:6
  13. Model:45
  14. Stepping:7
  15. CPU mhz:1200.000
  16. bogomips:4790.83
  17. Virtualization:vt-x
  18. L1D cache:32k//l1 Data Cache 32k
  19. l1i cache:32k//l1 Instruction Cache 32k (Cow x machine Performance, von Neumann + Harvard architecture)
  20. L2 cache:256k
  21. L3 cache:15360k
  22. NUMA node0 CPU (s): 0-5,24-29
  23. NUMA Node1 CPU (s): 6-11,30-35
  24. NUMA Node2 CPU (s): 12-17,36-41
  25. NUMA node3 CPU (s): 18-23,42-47

From the output, it can be seen that the current machine has 4 sockets, each sockets contains 1 NUMA node, each NUMA node has 6 cores, each cores contains 2 thread, so the total threads number =4 (sockets) x 1 (node) x6 (cores) x2 (threads) =48.

Alternatively, you can print out the number of socket,core and thread of the current machine using the script below.

  1. #!/bin/bash
  2. # Simple Print CPU topology
  3. # Author:kodango
  4. function Get_nr_processor ()
  5. {
  6. grep ' ^processor '/proc/cpuinfo | Wc-l
  7. }
  8. function Get_nr_socket ()
  9. {
  10. grep ' physical id '/proc/cpuinfo | Awk-f: ' {
  11. Print $ | "Sort-un"} ' | Wc-l
  12. }
  13. function Get_nr_siblings ()
  14. {
  15. grep ' Siblings '/proc/cpuinfo | Awk-f: ' {
  16. Print $ | "Sort-un"} '
  17. }
  18. function Get_nr_cores_of_socket ()
  19. {
  20. grep ' CPU cores '/proc/cpuinfo | Awk-f: ' {
  21. Print $ | "Sort-un"} '
  22. }
  23. Echo ' ===== CPU topology Table ===== '
  24. Echo
  25. Echo ' +--------------+---------+-----------+ '
  26. Echo ' | Processor ID | Core ID | Socket ID | '
  27. Echo ' +--------------+---------+-----------+ '
  28. while read line; Do
  29. If [-Z "$line"]; Then
  30. printf ' | %-12s | %-7s | %-9s |\n ' $p _id $c _id $s _id
  31. Echo ' +--------------+---------+-----------+ '
  32. Continue
  33. Fi
  34. If echo "$line" | Grep-q "^processor"; Then
  35. P_id= ' echo ' $line | Awk-f: ' {print $} ' | Tr-d ""
  36. Fi
  37. If echo "$line" | Grep-q "^core id"; Then
  38. C_id= ' echo ' $line | Awk-f: ' {print $} ' | Tr-d ""
  39. Fi
  40. If echo "$line" | Grep-q "^physical id"; Then
  41. S_id= ' echo ' $line | Awk-f: ' {print $} ' | Tr-d ""
  42. Fi
  43. Done </proc/cpuinfo
  44. Echo
  45. Awk-f: ' {
  46. if ($ ~/processor/) {
  47. Gsub (//, "", $);
  48. p_id=$2;
  49. } else if ($ ~/physical ID/) {
  50. Gsub (//, "", $);
  51. s_id=$2;
  52. ARR[S_ID]=ARR[S_ID] "" p_id
  53. }
  54. }
  55. end{
  56. For (i in ARR)
  57. printf "Socket%s:%s\n", I, arr[i];
  58. } '/proc/cpuinfo
  59. Echo
  60. Echo ' ===== CPU Info Summary ===== '
  61. Echo
  62. Nr_processor= ' Get_nr_processor '
  63. echo "Logical processors: $nr _processor"
  64. nr_socket= ' Get_nr_socket '
  65. echo "Physical socket: $nr _socket"
  66. nr_siblings= ' Get_nr_siblings '
  67. echo "Siblings in one socket: $nr _siblings"
  68. nr_cores= ' Get_nr_cores_of_socket '
  69. echo "Cores in one socket: $nr _cores"
  70. Let Nr_cores*=nr_socket
  71. echo "Cores in total: $nr _cores"
  72. If ["$nr _cores" = "$nr _processor"]; Then
  73. echo "Hyper-threading:off"
  74. Else
  75. echo "Hyper-threading:on"
  76. Fi
  77. Echo
  78. Echo ' ===== END ===== '

————————————————————

NUMA Architecture Detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.