In Linux, determine the number of CPU physical cores, whether it is hyper-threading or multi-core

Source: Internet
Author: User

Address: http://hi.baidu.com/xolee/blog/item/2bedc8b7ef2743e730add16c.html

1. 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
 
3. Check the CPU Cores
# Cat/proc/cpuinfo | grep "cores" | uniq
 
4. view the CPU clock speed
# Cat/proc/cpuinfo | grep MHz | uniq

 

 

 

 

 

 

 

 

 

 

#Uname-

Linux euis1 2.6.9-55. elsmp #1 SMP Fri APR 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux

(View the kernel information of the current operating system)

 

#CAT/etc/issue | grep Linux

Red Hat Enterprise Linux as Release 4 (nahant Update 5)

(View the released version of the current operating system)

 

#CAT/proc/cpuinfo | grep name | cut-F2-D: | uniq-C

8Intel (r) Xeon (r) CPU e5410 @ 2.33 GHz

(We can see eight logical CPUs and the CPU model)

 

#CAT/proc/cpuinfo | grep physical | uniq-C

4Physical ID: 0

4Physical ID: 1

(It means two 4-core CPUs)

 

#Getconf long_bit

32

(This indicates that the current CPU runs in 32bit mode, but does not indicate that the CPU does not support 64bit)

 

#CAT/proc/cpuinfo | grep flags | grep 'lm '| WC-l

8

(If the result is greater than 0, 64bit computing is supported. lm indicates long mode, and Lm indicates 64bit)

 

 

 

 

 

How to obtain CPU details:

Linux Command: CAT/proc/cpuinfo

Use commands to determine the number of physical CPUs and cores:

Logical CPU count:
# Cat/proc/cpuinfo | grep "processor" | WC-l

Number of physical CPUs:
# Cat/proc/cpuinfo | grep "physical ID" | sort | uniq | WC-l

Number of cores in each physical CPU:
# Cat/proc/cpuinfo | grep "CPU cores" | WC-l

Is it hyper-threading?
If two logical CPUs have the same core ID, hyper-threading is enabled.

The number of logical CPUs (possibly core, threads, or both) in each physical CPU:
# Cat/proc/cpuinfo | grep "Siblings"

 

 

 

 

 

 

 

1. View CPU information command CAT/proc/cpuinfo

2. Run the command CAT/proc/meminfo to view memory information.

3. Command fdisk-L to view hard disk Information

End

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.