Enter command: Cat/proc/cpuinfo
See the output of the physical ID there are several, if the display 0, then there is only one physical CPU;
View output processor There are several, if there are 0 and 12, so there are two logical CPUs.
(i) Conceptual
① Physical CPU
Number of CPUs on slots in actual server
Number of physical CPUs, several physical IDs can be counted
② Logical CPU
/proc/cpuinfo used to store CPU hardware information.
The information content lists the specification of processor 0–processor N respectively. Note here that n is the logical number of CPUs
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
③CPU Nuclear number
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
(ii) View CPU information
When we cat/proc/cpuinfo,
CPUs with the same core ID are the same core Hyper-threading
CPUs with the same physical ID are threads or cores encapsulated by the same CPU
(iii) The following examples illustrate
① 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
③ View CPU is a few cores
#cat/proc/cpuinfo |grep "Cores" |uniq
6
I am here should be 2 CPU, each CPU has 6 core, should be Intel's U, support Hyper-threading, so show 24