cpu规格
先看一个cpu的规格,比如Intel Xeon E5-2650 v2
http://detail.zol.com.cn/371/370742/param.shtml
主要看如下参数
核心数量:8核心
线程数量:16线程
最大CPU配置:2颗
超线程技术支持
上面的意思是:2颗CPU,每颗CPU有8核,每核有2个处理线程(超线程技术)
细节
先看一下Intel Xeon E5-2650 v2的信息
[root@c2 ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 62
Model name: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
Stepping: 4
CPU MHz: 1255.921
BogoMIPS: 5192.88
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-31
关键信息
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
按顺序
socket数量,也就是插槽是2个
总共的cpu物理核数,官方名字是叫节点node,是8个(每个socket里4个)
每个物理cpu抽象出2个处理线程
NUMA的数量1个,服务的线程是0-31
获取总线程数
[root@c2 ~]# grep '^processor' /proc/cpuinfo | wc -l
32
获取插槽数量
[root@c2 ~]# grep 'physical id' /proc/cpuinfo | awk -F: '{print $2 | "sort -un"}' | wc -l
2