Centos command to correctly identify the number of CPUs and cores

Source: Internet
Author: User
Judgment basis: 1. the cpu with the same coreid is hyper-threading of the same core. 2. a cpu with the same physicalid is a thread or cores encapsulated by the same cpu. Taking HP dlw.g6 as an example: ① number of physical CPUs: [root @ localhost ~] # Cat/proc/cpuinfo | grep "physicalid" | so

Judgment basis:
1. the cpu with the same core id is hyper-threading of the same core.
2. a cpu with the same physical id is a thread or cores encapsulated by the same cpu.

Taking HP dlw.g6 as an example:

① Number of physical CPUs:
[Root @ localhost ~] # Cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc-l
2
② Number of cores in each physical cpu (I .e. number of cores)
[Root @ localhost ~] # Cat/proc/cpuinfo | grep "cpu cores" | uniq
Cpu cores: 4
③ Number of logical CPUs (possibly core, threads, or both) in each physical cpu (Hyper-Threading is enabled)
[Root @ localhost ~] # Cat/proc/cpuinfo | grep "siblings" | uniq
Siblings: 8
Or cat/proc/cpuinfo | grep "processor" | wc-l

The cpu of this server is quite powerful. it is no wonder that there are 16 CPUs in many linux commands, such as iostat. please note the difference between physical cpu and logical cpu, do not confuse.

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.