Linuxunder ViewCPUthe information is mainly viewed by/proc/cpuinfothis file.
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/91/BF/wKiom1j4IenjCgNMAACt0ldo4w0747.png-wh_500x0-wm_ 3-wmp_4-s_2926230844.png "title=" qq picture 20170420104931.png "alt=" Wkiom1j4ienjcgnmaact0ldo4w0747.png-wh_50 "/>
first, for/proc/cpuinfofiles,we areneed to seeProcessor,Physical ID,siblings,Core ID,the CPU cores these several fields.
1. All logic with the same physical ID processor share the same physical socket. Each physical id represents a unique physical package, which is a CPU.
2.siblings represents the number of logical CPUs that reside on a physically encapsulated CPU.
3. Each core id represents a unique processor kernel All logical CPUs with the same core id are located on the same processor core.
4. If more than one logical CPU is useful for the same core ID and physical ID&NBSP, then the system supports Hyper-threading (HT) technology
5. If two or more logical CPUs have the same physical ID, but the core ID is different, this is a multi-core processor, and the CPU cores field can also indicate whether to support multiple cores.
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.
Second, the CPU status can be queried by the following methods.
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/91/C2/wKiom1j4L8WDr8DXAAClY6js7T4571.png-wh_500x0-wm_ 3-wmp_4-s_4187203088.png "title=" 1.png "alt=" Wkiom1j4l8wdr8dxaacly6js7t4571.png-wh_50 "/>
1. Number of logical CPUs:
# Cat/proc/cpuinfo | grep "Processor" | Wc–l
Or
# Cat/proc/cpuinfo | grep ' Processor ' | Sort | Uniq
2. Number of physical CPUs:
# Cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc–l
3. Number of cores per physical CPU:
# Cat/proc/cpuinfo | grep "CPU Cores" | Wc–l
4. Do you support Hyper-threading? If two logical CPUs have the same "core ID", then the Hyper-threading is turned on.
5. Number of logical CPUs in each physical CPU
# Cat/proc/cpuinfo | grep "siblings" | Wc–l
On this server, ' CPU cores ' for 8,physical ID has 1, core ID has 8, siblings value is 8, a total of 8 processor. so the CPU for this server host is 1 physically packaged processors(Physical ID), each processor has 8 processing cores (CPU cores), and each CPU core has only 1 logical processors (Hyper-Threading technology), so there are 8 logical processors on each physical processor with 8 processor in total.
Reference: http://blog.csdn.net/eroswang/archive/2009/04/16/4085310.aspx
https://www. CentOS . org/docs/5/html/5.1/deployment_guide/s2-proc-cpuinfo.html
Http://xuev.blogbus.com/logs/40695517.html
http://blog.csdn.net/sycflash/article/details/6643492
Linux/linuxfuwuqi_proc_cpuinfoxiangjie__9797_1345400293.html
This article is from the "Mq_douer" blog, make sure to keep this source http://douer.blog.51cto.com/6107588/1917686
View CPU information under Linux