一 查看cpu型号
root@localhost:~# grep name /proc/cpuinfo | sort | uniq
model name : Intel Core Processor (Broadwell, no TSX)
二 查看物理CPU个数
root@localhost:~# grep "physical id" /proc/cpuinfo | sort | uniq | wc -l
1
三 查看CPU核数
root@localhost:~# grep "core id" /proc/cpuinfo | sort | uniq | wc -l
2
四 查看CPU线程数
root@localhost:~# grep "processor" /proc/cpuinfo | sort | uniq | wc -l
4
五 lscpu命令
root@locaohost:~# lscpu
Architecture: x86_64 #架构
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 4 #逻辑cpu颗数
On-line CPU(s) list: 0-3 #在线的cpu数量
Thread(s) per core: 2 #每个核心线程
Core(s) per socket: 2 #每个cpu插槽核数/每颗物理cpu核数
Socket(s): 1 #cpu插槽数
NUMA node(s): 1
Vendor ID: GenuineIntel #cpu厂商ID
CPU family: 6
Model: 61 #型号
Model name: Intel Core Processor (Broadwell, no TSX)
Stepping: 2 #步进
CPU MHz: 2194.916 #cpu主频
BogoMIPS: 4389.83
Hypervisor vendor: KVM
Virtualization type: full #cpu支持的虚拟化技术
L1d cache: 64 KiB #cpu的L1数据缓存
L1i cache: 64 KiB #cpu的L1指令缓存
L2 cache: 8 MiB #二级缓存
L3 cache: 16 MiB #三级缓存
NUMA node0 CPU(s): 0-3