Check the number of physical CPUs, cores, logical CPUs, and linuxcpu in linux.

Source: Internet
Author: User

Check the number of physical CPUs, cores, logical CPUs, and linuxcpu in linux.

I. First, we need to clarify the concept of the number of physical CPUs, the number of cores, and the number of logical CPUs.

1. Number of physical CPUs: the number of CPUs actually inserted on the motherboard. You can specify the number of unique physical IDS (physical id)

2. Number of cpu cores: Number of chipsets that can process data on a single CPU, such as dual-core and quad-core (cpu cores)

3. logical cpu count: In general, logical cpu = number of physical CPUs × number of each core. If they are not equal, the CPU of the server supports hyper-Threading Technology (HT: Simply put, it enables one kernel in the processor to play a role in the operating system as two kernels. In this way, the execution resources available for the operating system are doubled, greatly improving the overall performance of the system. At this time, the logical cpu = the number of physical CPUs × the number of each core x2)

(Processer 0-n)

2. View cpu information by viewing/proc/cpuinfo

1. Number of physical CPUs: [XXXX @ server ~] $ Grep 'physical id'/proc/cpuinfo | sort | uniq | wc-l

2. Number of cpu cores: [XXXX @ server ~] $ Grep 'cpu cores'/proc/cpuinfo | uniq | awk-F': ''{print $2 }'

3. Logical cpu: [XXXX @ server ~] $ Cat/proc/cpuinfo | grep "processor" | wc-l

We can see that my computer has a single cpu, 4 cores, and no hyper-threading.

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.