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