How can I see how many physical CPUs and the number of cores per CPU there are on my current Linux system?

图片[1]-如何看当前Linux系统有几颗物理CPU和每颗CPU的核数?-光子波动网-免费分享跨境知识和技术知识

This can be done with the command line tool lscpu to view the CPU information of the current Linux system, including the number of physical CPUs, the number of cores of each physical CPU, CPU model, etc.

Open a terminal and enter the following command to view CPU information:

Copy codelscpu

After executing this command, a message similar to the following is output:

lessCopy codeArchitecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 58
Model name: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
Stepping: 9
CPU MHz: 1201.000
CPU max MHz: 3100.0000
CPU min MHz: 1200.0000
BogoMIPS: 4988.43
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3

In the output, the following important parameters can be found:

  • CPU(s): Indicates the number of CPUs in the current system, including logical and physical CPUs.
  • Thread(s) per core: Indicates the number of threads in each core, i.e. the number of threads supported by Hyper-Threading Technology. If Hyper-Threading is not supported, the value is 1.
  • Core(s) per socket: Indicates the number of cores in each physical CPU.
  • Socket(s): Indicates the number of physical CPUs in the current system.

Based on the above parameters, you can calculate the number of physical CPUs and the number of cores of each physical CPU in the current system. For example, in the above output, the number of physical CPUs is 1 and the number of cores per physical CPU is 2.

© copyright statement
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments