Chinaunix首页 | 论坛 | 博客
  • 博客访问: 98345
  • 博文数量: 23
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 140
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-22 10:44
文章分类

全部博文(23)

文章存档

2018年(3)

2017年(1)

2015年(1)

2014年(18)

我的朋友

分类: 服务器与存储

2018-04-16 19:43:30

命令:

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

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

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 相同。但是差距比较小。

未验证部分参考:https://blog.csdn.net/shaoyunzhe/article/details/53606584
阅读(8612) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~