1[Email protected]:~$ cat/proc/Cpuinfo2processor:03VENDOR_ID:Genuineintel4CPU Family:155Model:26Model Name:intel (R) Pentium (r) 4 CPU 3.00GHz7Stepping:98microcode:0x179CPU mhz:2992.615TenCache size:512KB OnePhysical id:0 ASiblings:2 -Core id:0 -CPU Cores:1 theapicid:0 -Initial apicid:0 -Fdiv_bug:No -Hlt_bug:No +F00f_bug:No -Coma_bug:No +Fpu:Yes AFpu_exception:Yes atCPUID Level:2 -Wp:Yes -Flags:FPU vme de PSE TSC MSR PAE MCE cx8 APIC MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE P EBS BTS CID XTPR -bogomips:5985.23 -Clflush size:64 -cache_alignment:128 inAddress sizes:36 bits Physical,Virtual -Power Management: to +Processor:1 -VENDOR_ID:Genuineintel theCPU Family:15 *Model:2 $Model Name:intel (R) Pentium (r) 4 CPU 3.00GHzPanax NotoginsengStepping:9 -microcode:0x17 theCPU mhz:2992.615 +Cache size:512KB APhysical id:0 theSiblings:2 +Core id:0 -CPU Cores:1 $Apicid:1 $Initial apicid:1 -Fdiv_bug:No -Hlt_bug:No theF00f_bug:No -Coma_bug:NoWuyiFpu:Yes theFpu_exception:Yes -CPUID Level:2 WuWp:Yes -Flags:FPU vme de PSE TSC MSR PAE MCE cx8 APIC MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE P EBS BTS CID XTPR Aboutbogomips:5990.44 $Clflush size:64 -cache_alignment:128 -Address sizes:36 bits Physical,Virtual -Power Management:
Enter the command cat/proc/cpuinfo view physical ID There are several, the above results show only 0, so there is only one physical CPU; There are several processor, the above results show 0 and 12, so there are two logical CPUs.
(i) Concept
① Physical CPU
Number of CPUs on the actual server slots
Number of physical CPUs, number of physical IDs that can be repeated
② Logical CPU
/proc/cpuinfo used to store CPU hardware information.
The information content lists the specifications of processor 0–processor N, respectively. It is important to note that N is the number of logical CPUs
In general, we think that a CPU can have multicore, plus Intel's Hyper-Threading Technology (HT), can logically divide the number of CPU core out
Number of logical CPUs = number of physical CPUs x CPU cores This specification value x 2 (if HT is supported and turned on)
Note: Linux top view CPU is also the number of logical CPUs
③CPU Number of cores
The number of chipsets that can process data on a CPU, such as the current i5 760, is a dual-core four-thread CPU, while i5 2250 is a quad-core four-thread CPU
In general, the number of physical CPUs x per core should be equal to the number of logical CPUs, if not equal, it means that the server's CPU support Hyper-Threading Technology
(ii) View CPU information
When we are Cat/proc/cpuinfo,
CPUs with the same core ID are Hyper-threading of the same core
CPUs with the same physical ID are the same CPU-encapsulated thread or core
(c) 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 should be 2 CPUs, each CPU has 6 cores, should be Intel's U, support Hyper-threading, so display 24
See CPU physical and logical numbers under Linux