View the number of Linux server CPUs

Source: Internet
Author: User

First, distinguish between two concepts: the physical CPU and the logical CPU.

The physical CPU is the actual CPU installed on the server. But a physical CPU can have multiple cores. For example, a i5 760 is a dual core, and a i5 2250 is a quad core. If you turn on Intel's Hyper-Threading Technology (HT), you can logically divide the kernel one more times. That is

Number of logical CPUs = number of physical CPUs x CPU cores. If HT is turned on, then x 2.

So, how do I view this information?

Linux, you can get the CPU information by viewing the contents of the/proc/cpuinfo file. The following is an example:

  

This file stores all the logical CPU information, in this example, there is only one logical CPU. If there are more than one, there will be multiple paragraphs similar to this information.

Explanation of the meaning of some fields:

Processor: The number of the logical CPU.

VENDOR_ID:CPU manufacturer.

The CPU family:cpu belongs to the product family.

Model:cpu belongs to which generation in the series.

The name, number, and frequency of the model NAME:CPU.

The design or production version of the STEPPING:CPU.

CPU MHZ:CPU The actual use of the main frequency.

Cache Size:cpu level two buffer size.

Physical ID: Physical CPU number.

Siblings: The number of logical CPUs for the current physical CPU.

Core ID: The number of the kernel on which the current logical CPU is located. A different logical CPU with the same core ID is a hyper-thread of the same core.

CPU Cores: The number of cores of the current physical CPU.

Flags: Features currently supported by the CPU.

Bogomips: The CPU speed is roughly measured at the start of the system kernel, in units of millions of instructions per second.

Address sizes: The number of addresses that can be accessed.

So

To know the number of logical CPUs for a server, use the command: Cat/proc/cpuinfo | grep ' Processor ' | Wc-l

To know the number of physical CPUs on a server, use the command: Cat/proc/cpuinfo | grep ' Physical ID ' | Sort | Uniq | Wc-l

View the number of Linux server CPUs

Related Article

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.