View CPU information under Linux

Source: Internet
Author: User

In the Linux operating system, the CPU information is loaded into the Cpuinfo file under the virtual directory/proc in the boot process, and we can view it through Cat/proc/cpuinfo:

Is my computer CPU information, below we analyze some of the more important indicators:

  • processor The ID of the logical processor.
  • ID of the processor that physical ID physically encapsulates.
  • The ID of the core ID for each key.
  • CPU Cores The number of cores in the same physically encapsulated processor.
  • siblings The number of logical processors in the same physically encapsulated processor.

We go back to see, my physical ID is 0, indicating that I have only one physical processor;

My processor has two different numbers and belongs to a physical ID, and the CPU cores has a value of 2, which means that my CPU is dual-core and that each core has only one logical processor.

To deepen our understanding of these parameters, let's look at another picture, which is a server for a workstation:

On this server, ' CPU cores ' for 4,physical ID has two, core ID has 8, siblings value is 8, a total of 16 processor.

so this server host CPU is 2 physically packaged processors, each processor has 4 processing cores (CPU cores), each CPU core can be divided into 2 logical processors (Hyper-Threading technology), so there are 8 logical processors on each physical processor, A total of 16 processor. this time you understand. The general structure is as follows:

Instruction Summary:

View all CPU information: $cat/proc/cpuinfo

To view the ID information for the physical CPU Processor: $cat/proc/cpuinfo | grep "Physical ID" | Sort-n | Uniq

To view the number of physical CPU processors: $cat/proc/cpuinfo | grep "Physical ID" | Sort-n | Uniq | Wc-l

View core information for each physical CPU Processor: $cat/proc/cpuinfo | grep "CPU Cores" | Sort-n | Uniq

This will know the number of physical CPU processors and the number of cores per physical CPU

To view the ID information for a logical CPU Processor: $cat/proc/cpuinfo | grep "Processor"

To view the total number of logical CPU processors: $cat/proc/cpuinfo | grep "Processor" | Wc-l

View the number of logical CPU processors for each physical CPU Processor: $cat/proc/cpuinfo | grep "Sibling" | Sort-n | Uniq

View CPU information 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.