See CPU physical and logical numbers under Linux

Source: Internet
Author: User

[Plain]View PlainCopy
  1. [Email protected]:~$ cat/proc/cpuinfo
  2. processor:0
  3. Vendor_id:genuineintel
  4. CPU Family:15
  5. Model:2
  6. Model Name:intel (R) Pentium (r) 4 CPU 3.00GHz
  7. Stepping:9
  8. microcode:0x17
  9. CPU mhz:2992.615
  10. Cache size:512 KB
  11. Physical id:0
  12. Siblings:2
  13. Core id:0
  14. CPU Cores:1
  15. apicid:0
  16. Initial apicid:0
  17. Fdiv_bug:no
  18. Hlt_bug:no
  19. F00f_bug:no
  20. Coma_bug:no
  21. Fpu:yes
  22. Fpu_exception:yes
  23. CPUID Level:2
  24. Wp:yes
  25. 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 pebs BTS CID XTPR
  26. bogomips:5985.23
  27. Clflush size:64
  28. cache_alignment:128
  29. Address sizes:36 bits physical, bits virtual
  30. Power Management:
  31. Processor:1
  32. Vendor_id:genuineintel
  33. CPU Family:15
  34. Model:2
  35. Model Name:intel (R) Pentium (r) 4 CPU 3.00GHz
  36. Stepping:9
  37. microcode:0x17
  38. CPU mhz:2992.615
  39. Cache size:512 KB
  40. Physical id:0
  41. Siblings:2
  42. Core id:0
  43. CPU Cores:1
  44. Apicid:1
  45. Initial apicid:1
  46. Fdiv_bug:no
  47. Hlt_bug:no
  48. F00f_bug:no
  49. Coma_bug:no
  50. Fpu:yes
  51. Fpu_exception:yes
  52. CPUID Level:2
  53. Wp:yes
  54. 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 pebs BTS CID XTPR
  55. bogomips:5990.44
  56. Clflush size:64
  57. cache_alignment:128
  58. Address sizes:36 bits physical, bits virtual
  59. 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
㈡ Viewing 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
㈢ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.