numa总结

命令:

yum install numactl

numastat

numactl --hardware

cat  /sys/class/net/enp129s0f0/device/numa_node 

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

numa_hit是打算在该节点上分配内存,最后从这个节点分配的次数;

num_miss是打算在该节点分配内存,最后却从其他节点分配的次数;

num_foregin是打算在其他节点分配内存,最后却从这个节点分配的次数;

interleave_hit是采用interleave策略最后从该节点分配的次数;

local_node该节点上的进程在该节点上分配的次数

other_node是其他节点进程在该节点上分配的次数

4、查看numa相关信息,包括每个node内存大小,每个node中的逻辑cpu

numactl --hardware

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

5、查看网卡对应的numa node

enp129s0f0是网卡的名字

cat  /sys/class/net/enp129s0f0/device/numa_node 

6、查看cpu负载

mpstat -P ALL(需要安装sysstat)

7、查看网卡所属numa节点

cat /sys/bus/pci/devices/0000\:86\:00.0//numa_node

8、 测试(访问不同节点的内存的IO)(参考linux NUMA技术_wu7244582的专栏-CSDN博客_linux numa

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
明显访问同一节点的内存速度比访问不同节点内存的速度快。
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 相同。但是差距比较小。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值