调优之内存调优-NUMA




Non-Uniform Memory Access (NUMA)

[root@uplook ~]# 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   24个逻辑cpu
cpubind: 0 1 
nodebind: 0 1 
membind: 0 1
 
[root@uplook ~]# numactl --hardware
available: 2 nodes (0-1)   2个numa节点 1个不支持
node 0 cpus: 0 1 2 3 4 5 12 13 14 15 16 17
node 0 size: 32740 MB
node 0 free: 544 MB
node 1 cpus: 6 7 8 9 10 11 18 19 20 21 22 23
node 1 size: 32768 MB
node 1 free: 108 MB
node distances:
node   0   1 
  0:    10  21 
  1:    21  10 
 
节点0 访问0号节点距离为10  访问远端21 就近访问

cgroup:
LAB1:
[root@uplook ~]# vim /etc/cgconfig
 group node0 {
           cpuset {
                cpuset.cpus=0-5,12-17;
                cpuset.mems=0;    内存节点     
           }
}
 group node1 {
           cpuset {
                cpuset.cpus=6-11,18-23;
                cpuset.mems=1;         
           }
}


[root@uplook ~]# vim /etc/cgrules.conf
*:/usr/sbin/httpd       cpuset      node0/

[root@uplook ~]# service cgred restart
[root@uplook ~]# service cgconfig restart

查看进程工作的CPU及内存节点:
[root@uplook ~]# watch -n.5 ps o psr,comm,pid

top 按f命令,添加字段j,显示进程上次使用的的CPU
rhel7  top F  国标移动到P 空格选择   shfit+W保存

[root@uplook ~]# numastat 
                                node0             node1
numa_hit                    68147645       102356480
numa_miss                 914974           341117
numa_foreign              341117          914974
interleave_hit              20159            20155
local_node                  67910717      102332020
other_node                 1151902        365577


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值