" 目录:RHCA+ -> 15 硬件管理 -> 12 numactl命令(管理numa) "

查看、管理numa;语法格式:numactl 参数
|-------------------|-------------------------------------|
| 参数 | 作用 |
| --hardware, -H | 查看numa结构 |
| --show, -s | 查看策略 |
| --interleave, -i | 平均使用各node资源 |
| --membind, -m | 使用哪个node的内存 |
| --cpunodebind, -N | 使用哪个node的cpu |
| --preferred, -p | 应该优先用哪个node的cpu和内存 |
| --localalloc, -l | 限制程序只使用node本地内存,不能使用其他node内存;cpu不限制 |
一、安装
root@wuzuniao \~# yum -y install numactl #安装工具
二、使用
root@wuzuniao \~# numactl -H #查看服务器上的numa数量及每个node内的cpu和内存数
available: 1 nodes (0)
node 0 cpus: 0
node 0 size: 958 MB
node 0 free: 89 MB
node distances:
node 0
0: 10
root@wuzuniao \~# numactl -s #查看策略
policy: default
preferred node: current
physcpubind: 0
cpubind: 0
nodebind: 0
membind: 0
root@wuzuniao \~# numactl #输入错误就会弹出命令帮助
usage: numactl --all \| -a --interleave= \| -i --preferred= \| -p
--physcpubind= \| -C \] \[--cpunodebind= \| -N
--membind= \| -m --localalloc \| -l command args ...
numactl --show \| -s
numactl --hardware \| -H
numactl --length \| -l --offset \| -o --shmmode \| -M
--strict \| -t
--shmid \| -I --shm | -S
--shmid \| -I --file | -f
--huge \| -u\] \[--touch \| -T
memory policy | --dump | -d | --dump-nodes | -D
memory policy is --interleave | -i, --preferred | -p, --membind | -m, --localalloc | -l
is a comma delimited list of node numbers or A-B ranges or all.
Instead of a number a node can also be:
netdev:DEV the node connected to network device DEV
file:PATH the node the block device of path is connected to
ip:HOST the node of the network device host routes through
block:PATH the node of block device path
pci:seg:bus:dev:func The node of a PCI device
is a comma delimited list of cpu numbers or A-B ranges or all
all ranges can be inverted with !
all numbers and ranges can be made cpuset-relative with +
the old --cpubind argument is deprecated.
use --cpunodebind or --physcpubind instead
can have g (GB), m (MB) or k (KB) suffixes
root@wuzuniao \~#