Linux 我如何知道我的服务器是否有 NUMA?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11126093/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I know if my server has NUMA?
提问by pr4n
Hopping from Java Garbage Collection, I came across JVM settings for NUMA. Curiously I wanted to check if my CentOS server has NUMA capabilities or not. Is there a *ix command or utility that could grab this info?
从 Java Garbage Collection 跳出来,我遇到了 NUMA 的 JVM 设置。奇怪的是,我想检查一下我的 CentOS 服务器是否具有 NUMA 功能。是否有 *ix 命令或实用程序可以获取此信息?
采纳答案by Nikolai Fetissov
I'm no expert here, but here's something:
我不是这里的专家,但这里有一些东西:
Box 1, no NUMA:
框 1,没有 NUMA:
~$ dmesg | grep -i numa
[ 0.000000] No NUMA configuration found
Box 2, some NUMA:
方框 2,一些 NUMA:
~$ dmesg | grep -i numa
[ 0.000000] NUMA: Initialized distance table, cnt=8
[ 0.000000] NUMA: Node 4 [0,80000000) + [100000000,280000000) -> [0,280000000)
回答by Donald_W
I think this previous question is similar: How to confirm NUMA?
我认为上一个问题类似:如何确认 NUMA?
In particular, you can review the NUMA man page here: http://man7.org/linux/man-pages/man7/numa.7.html
特别是,您可以在此处查看 NUMA 手册页:http: //man7.org/linux/man-pages/man7/numa.7.html
And from there you'll see:
从那里你会看到:
$ find /proc -name numa_maps
/proc/1/task/1/numa_maps
/proc/1/numa_maps
/proc/2/task/2/numa_maps
/proc/2/numa_maps
/proc/3/task/3/numa_maps
[etc if you have numa]
And you can get more detail like so:
您可以获得更多详细信息,如下所示:
$ grep NUMA=y /boot/config-`uname -r`
CONFIG_NUMA=y
CONFIG_K8_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_ACPI_NUMA=y
$ numactl --hardware
available: 2 nodes (0-1)
node 0 size: 18156 MB
node 0 free: 9053 MB
node 1 size: 18180 MB
node 1 free: 6853 MB
node distances:
node 0 1
0: 10 20
1: 20 10
回答by Kadir
For Redhat 4,5,6 and 7 systems, one can try the following to determine if NUMA configuration is disabled:
对于 Redhat 4、5、6 和 7 系统,可以尝试以下方法来确定是否禁用了 NUMA 配置:
numactl --show does not show multiple nodes
numactl --show 不显示多个节点
# numactl --show
policy: default
preferred node: current
physcpubind: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
cpubind: 0
nodebind: 0
membind: 0
or numactl --hardware does not list multiple nodes
或 numactl --hardware 未列出多个节点
# numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
node 0 size: 524163 MB
node 0 free: 505253 MB
node distances:
node 0
0: 10
回答by zgerd
You can also just query the information from /sys
(this is what tools like numactl
do underneath). As others pointed out, using dmesg will be unreliable since it usually does not have unlimited buffering.
您也可以只查询信息/sys
(这就是numactl
下面的工具所做的事情)。正如其他人指出的那样,使用 dmesg 是不可靠的,因为它通常没有无限缓冲。
To find out how many NUMA nodes are currently available, do:
要了解当前可用的 NUMA 节点数量,请执行以下操作:
cat /sys/devices/system/node/online
0-3
回答by Learner
You can also get this info from lscpu command:
您还可以从 lscpu 命令获取此信息:
lscpu | grep -i numa
NUMA node(s): 2
NUMA node0 CPU(s): 0-19,40-59
NUMA node1 CPU(s): 20-39,60-79