美文网首页
numactl工具使用

numactl工具使用

作者: _Irving | 来源:发表于2023-02-15 14:36 被阅读0次

安装

$yum install -y numactl

命令:numstat

[root@localhost ~]# numastat
                           node0
numa_hit                30772351
numa_miss                      0
numa_foreign                   0
interleave_hit             13741
local_node              30772351
  • numa_hit:是打算在该节点分配内存,最后从这个节点分配的次数
  • num_mis:是打算在该节点分配内存,最后却从其他节点分配的次数
  • num_foregin:是打算在其他节点分配内存,最后却从这个节点分配的次数
  • interleave_hit:是采用interleave策略最后从该节点分配的次数
  • local_node:该节点上的进程在该节点上分配的次数
  • other_node:是其他节点进程在该节点上份分配的次数

总结:
1、num_miss是比较关键的参数,如果此值过高的话,说明当个node的内存命中率比较低,此时可能需要绑定cpu战略
2、使用参数-p可以查看单个进程在不同node下,内存的分布情况

[root@localhost ~]# numastat -p 847

Per-node process memory usage (in MBs) for PID 847 (vmtoolsd)
                           Node 0           Total
                  --------------- ---------------
Huge                         0.00            0.00
Heap                         0.59            0.59
Stack                        0.04            0.04
Private                      5.79            5.79
----------------  --------------- ---------------
Total                        6.42            6.42

3、使用监控命令watch -n1 --differences numastatj监控miss值变化,如果太高的时候可以考虑绑定node

[root@localhost ~]# watch -n1 --differences numastat

numactl

numactl --hardware

[root@localhost ~]# numactl --hardware
available: 1 nodes (0)
node 0 cpus: 0
node 0 size: 2047 MB
node 0 free: 214 MB
node distances:
node   0 
  0:  10 
  • 若多个cpu的空闲内存差异很大,说明分配严重不均衡,可能会导致swap
    numactl --show
[root@localhost ~]# numactl --show
policy: default
preferred node: current
physcpubind: 0 
cpubind: 0 
nodebind: 0 
membind: 0 

相关文章

网友评论

      本文标题:numactl工具使用

      本文链接:https://www.haomeiwen.com/subject/ipeekdtx.html