[1] Physical CPU: The number of CPUs on the slot in the actual server.
Number of physical CPUs: There are several physical IDs that can be counted without duplicates.
[2] Logical CPU
Linux users are certainly not unfamiliar with the/proc/cpuinfo file. It is used to store CPU hardware information.
The information content lists the specifications of the processor 0–n respectively. Notice here that if you think n is the real number of CPUs, it's a big mistake.
In general, we think that a CPU can have multi-core, plus Intel's Hyper-Threading Technology (HT), which can logically be divided into a second number of CPU core out
Logical CPUs = number of physical CPUs x CPU cores This metric value x 2 (if HT is supported and turned on)
Note: Linux top view CPU is also the number of logical CPUs
[3] CPU Kernel Count
The number of chipsets that can process data on a single CPU, such as the current i5 760, is a dual-core four-thread CPU, and i5 2250 is a quad-core four-threaded CPU
In general, the number of physical CPUs x per kernel should equal the number of logical CPUs, if not equal, the server's CPU support Hyper-Threading Technology
2. View CPU Information
When we cat/proc/cpuinfo, CPUs with the same core ID are the same core hyper-threading, and CPUs with the same physical IDs are threads or cores encapsulated by the same CPU.
3, the following examples illustrate
[0] View CPU model
The code is as follows |
Copy Code |
# Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c Intel (R) Xeon (r) CPU E5620 @ 2.40GHz |
[1] View the number of physical CPUs
The code is as follows |
Copy Code |
# Cat/proc/cpuinfo |grep "Physical id" |sort |uniq|wc-l 2 |
[2] View the number of logical CPUs
The code is as follows |
Copy Code |
# Cat/proc/cpuinfo |grep "Processor" |wc-l 16 |
[3] View CPU is a few cores
The code is as follows |
Copy Code |
# cat/proc/cpuinfo |grep "Cores" |uniq 4 |
I am here should be 2 CPU, each CPU has 4 core, is Intel's U, support Hyper-threading, so show 16