物理CPU个数:物理cpu就是主板上的cpu数量,可通过不重复的physical id判断
ejuoajy5x6zakvmZ:~$ cat /proc/cpuinfo | grep "physical id"physical id : 0physical id : 0physical id : 0physical id : 0
逻辑CPU个数:就是processor
18kejuoajy5x6zakvmZ:~$ cat /proc/cpuinfo | grep "processor"processor : 0processor : 1processor : 2processor : 3oajy5x6zakvmZ:~$ cat /proc/cpuinfo | grep "processor" | wc -l4
CPU核心数:如双核、四核等 (cpu cores 核心)
jy5x6zakvmZ:~$ cat /proc/cpuinfo | grep "cpu cores"cpu cores : 2cpu cores : 2cpu cores : 2cpu cores : 2
5x6zakvmZ:~$ lscpuArchitecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 4 # 逻辑cpu个数On-line CPU(s) list: 0-3Thread(s) per core: 2 # 每个cpu核心数Core(s) per socket: 2 # 物理cpuSocket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelCPU family: 6Model: 85Model name: Intel(R) Xeon(R) Gold 6149 CPU @ 3.10GHzStepping: 4CPU MHz: 3100.000BogoMIPS: 6200.00Hypervisor vendor: KVMVirtualization type: fullL1d cache: 32KL1i cache: 32KL2 cache: 1024KL3 cache: 22528KNUMA node0 CPU(s): 0-3
总的逻辑Cpu = 物理Cpu个数 * 每个物理cpu核心数
如果开启了超线程,总的逻辑cpu就是没开超线程时总的逻辑cpu个数的两倍
