How to view CPU configuration information in Linux, and how to view cpu configuration in linux
Enter the command: cat/proc/cpuinfo
Check the number of physical IDs in the output result. If 0 is displayed, there is only one physical cpu;
Check the number of processor output results. If there are 0 and 1, there are two logical CPUs.
(1) Concepts
① Physical CPU
Number of CPUs in the actual Server slot
Number of physical CPUs, which can contain a few unique physical IDS
② Logical CPU
/Proc/cpuinfo is used to store cpu hardware information
The information lists the specifications of processor 0-processor n. Note that n is the number of logical CPUs.
In general, we think that a cpu can have multiple cores, and intel's hyper-Threading Technology (HT) can be logically split into multiple cpu cores.
Logical cpu count = physical cpu count x cpu cores specification value x 2 (if ht is supported and enabled)
Note: in Linux, the top view CPU is also the number of logical CPUs.
③ Number of CPU Cores
The number of chipsets that can process data on a CPU. For example, the current i5 760 is a dual-core four-thread CPU, while the i5 2250 is a four-core four-thread CPU.
In general, the number of physical CPUs × the number of each core should be equal to the number of logical CPUs. Otherwise, the CPU of the server supports hyper-Threading Technology.
(2) view CPU Information
When we cat/proc/cpuinfo,
CPU with the same core id is hyper-threading of the same core
A cpu with the same physical id is a thread or core encapsulated by the same CPU.
(3) examples below
① View the number of physical CPUs
# Cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc-l
2
② View the number of logical CPUs
# Cat/proc/cpuinfo | grep "processor" | wc-l
24
③ Check the CPU Cores
# Cat/proc/cpuinfo | grep "cores" | uniq
6
Here I should have 2 CPUs, each of which has 6 cores, which should be Intel's U, supporting hyper-threading, so the display is 24