centos numa查看命令

命令:
yum install numactl
numastat
numactl –hardware
mpstat -P ALL
lscpu
1、centos 安装支持numa命令
yum install numactl
2、验证系统是否支持numa
dmesg | grep -i numa查看输出结果:
如果输出结果为:
No NUMA configuration found
说明numa为disable,如果不是上面的内容说明numa为enable

3、查看numa的状态 numastat
numastat
[root@localhost sbin]# numastat
node0
numa_hit 1090765539
numa_miss 0
numa_foreign 0
interleave_hit 22547
local_node 1090765539
other_node 0

numa_hit是打算在该节点上分配内存,最后从这个节点分配的次数;
num_miss是打算在该节点分配内存,最后却从其他节点分配的次数;
num_foregin是打算在其他节点分配内存,最后却从这个节点分配的次数;
interleave_hit是采用interleave策略最后从该节点分配的次数;
local_node该节点上的进程在该节点上分配的次数
other_node是其他节点进程在该节点上分配的次数

4、查看numa相关信息,包括每个node内存大小,每个node中的逻辑cpu
numactl –hardware
[root@localhost sbin]# numactl –hardware
available: 1 nodes (0)
node 0 cpus: 0 1 2 3
node 0 size: 16304 MB
node 0 free: 10989 MB
node distances:
node 0
0: 10

lscpu命令也可以查看呢cpu和node的关系

5、查看网卡对应的numa node

6、查看cpu负载

mpstat -P ALL(需要安装sysstat)

7、 测试(访问不同节点的内存的IO)
(参考http://blog.csdn.net/wu7244582/article/details/52807117
1) write 测试
#numactl –cpubind=0 –membind=0 dd if=/dev/zero of=/dev/shm/A bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.823497 s, 1.3 GB/s

# numactl –cpubind=0 –membind=1 dd if=/dev/zero of=/dev/shm/A bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.936182 s, 1.1 GB/s

明显访问同一节点的内存速度比访问不同节点内存的速度快。

扫描二维码关注公众号,回复: 3214823 查看本文章

2) read 测试
# numactl –cpubind=0 –membind=0 dd if=/dev/shm/A of=/dev/null bs=1K count=1024K
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 1.09543 s, 980 MB/s

# numactl –cpubind=0 –membind=1 dd if=/dev/shm/A of=/dev/null bs=1K count=1024K
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 1.11862 s, 960 MB/s

结论和write 相同。但是差距比较小。

猜你喜欢

转载自blog.csdn.net/weixin_42651205/article/details/81911737