Linux view number of physical CPUs, number of cores, logical CPUs

Source: Internet
Author: User

# total number of cores = number of physical CPUs X number of cores per physical CPU
# Total Logical CPUs = number of physical CPUs x number of cores per physical CPU X number of hyper-threads

# View the number of physical CPUs
cat/proc/cpuinfo| grep "Physical ID" | Sort| uniq| Wc-l

# See the number of cores in each physical CPU (that is, the number of nuclei)
cat/proc/cpuinfo| grep "CPU Cores" | Uniq

# View the number of logical CPUs
cat/proc/cpuinfo| grep "Processor" | Wc-l

#查看CPU信息 (model)
Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c

#查看内存信息
Cat/proc/meminfo

Attached query case:

[Email protected] ~]# Cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc-l
2
[Email protected] ~]# Cat/proc/cpuinfo | grep "CPU Cores" | Uniq
CPU Cores:2
[Email protected] ~]# Cat/proc/cpuinfo | grep "Processor" | Wc-l
4
[Email protected] ~]# Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c
4 Intel (R) Xeon (r) CPU 5110 @ 1.60GHz
[Email protected] ~]# Cat/proc/meminfo
memtotal:16331308 KB
memfree:1337728 KB
buffers:371616 KB
cached:12640528 KB
swapcached:1416 KB
active:3476580 KB
inactive:10799168 KB
Active (anon): 1260328 KB
Inactive (anon): 4692 KB
Active (file): 2216252 KB
Inactive (file): 10794476 KB
unevictable:0 KB
mlocked:0 KB
swaptotal:32767996 KB
swapfree:32763756 KB
Dirty:60 KB
writeback:0 KB
anonpages:1262288 KB
mapped:26500 KB
shmem:1416 KB
slab:535744 KB
sreclaimable:499776 KB
sunreclaim:35968 KB
kernelstack:6928 KB
pagetables:17168 KB
nfs_unstable:0 KB
bounce:0 KB
writebacktmp:0 KB
commitlimit:40933648 KB
committed_as:2875128 KB
vmalloctotal:34359738367 KB
vmallocused:317108 KB
vmallocchunk:34359398588 KB
hardwarecorrupted:0 KB
anonhugepages:1112064 KB
hugepages_total:0
hugepages_free:0
hugepages_rsvd:0
hugepages_surp:0
hugepagesize:2048 KB
directmap4k:7840 KB
directmap2m:16769024 KB

[Email protected] ~]# Cat/proc/cpuinfo
processor:0
Vendor_id:genuineintel
CPU Family:6
Model:15
Model Name:intel (R) Xeon (r) CPU 5110 @ 1.60GHz
Stepping:6
microcode:201
CPU mhz:1596.132
Cache size:4096 KB
Physical id:0
Siblings:2
Core id:0
CPU Cores:2
apicid:0
Initial apicid:0
Fpu:yes
Fpu_exception:yes
CPUID Level:10
Wp:yes
FLAGS:FPU VME de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE syscall nx LM constant_tsc Arch_perfmon pebs BTS rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 SSSE3 cx16 XTPR pdcm DCA LAHF_LM DTS Tpr_shadow
bogomips:3192.26
Clflush size:64
Cache_alignment:64
Address sizes:36 bits physical, bits virtual
Power Management:

Processor:1
Vendor_id:genuineintel
CPU Family:6
Model:15
Model Name:intel (R) Xeon (r) CPU 5110 @ 1.60GHz
Stepping:6
microcode:201
CPU mhz:1596.132
Cache size:4096 KB
Physical Id:3
Siblings:2
Core id:0
CPU Cores:2
Apicid:6
Initial Apicid:6
Fpu:yes
Fpu_exception:yes
CPUID Level:10
Wp:yes
FLAGS:FPU VME de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE syscall nx LM constant_tsc Arch_perfmon pebs BTS rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 SSSE3 cx16 XTPR pdcm DCA LAHF_LM DTS Tpr_shadow
bogomips:3192.10
Clflush size:64
Cache_alignment:64
Address sizes:36 bits physical, bits virtual
Power Management:

Processor:2
Vendor_id:genuineintel
CPU Family:6
Model:15
Model Name:intel (R) Xeon (r) CPU 5110 @ 1.60GHz
Stepping:6
microcode:201
CPU mhz:1596.132
Cache size:4096 KB
Physical id:0
Siblings:2
Core Id:1
CPU Cores:2
Apicid:1
Initial apicid:1
Fpu:yes
Fpu_exception:yes
CPUID Level:10
Wp:yes
FLAGS:FPU VME de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE syscall nx LM constant_tsc Arch_perfmon pebs BTS rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 SSSE3 cx16 XTPR pdcm DCA LAHF_LM DTS Tpr_shadow
bogomips:3192.26
Clflush size:64
Cache_alignment:64
Address sizes:36 bits physical, bits virtual
Power Management:

Processor:3
Vendor_id:genuineintel
CPU Family:6
Model:15
Model Name:intel (R) Xeon (r) CPU 5110 @ 1.60GHz
Stepping:6
microcode:201
CPU mhz:1596.132
Cache size:4096 KB
Physical Id:3
Siblings:2
Core Id:1
CPU Cores:2
Apicid:7
Initial Apicid:7
Fpu:yes
Fpu_exception:yes
CPUID Level:10
Wp:yes
FLAGS:FPU VME de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE syscall nx LM constant_tsc Arch_perfmon pebs BTS rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 SSSE3 cx16 XTPR pdcm DCA LAHF_LM DTS Tpr_shadow
bogomips:3192.10
Clflush size:64
Cache_alignment:64
Address sizes:36 bits physical, bits virtual
Power Management:

Linux view number of physical CPUs, number of cores, logical CPUs

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.