Linux CPU 信息查看

 

 

我们可以用/proc/cpuinfo 查看CPU 的信息。 该文件包含系统上每个处理器的数据段落。/proc/cpuinfo 描述中有 6 个条目适用于多内核和超线程(HT技术检查:processor, vendor id, physical id, siblings, core id cpu cores

1processor:包括这一逻辑处理器的唯一标识符。

2physical id :包括每个物理封装的唯一标识符。

3core id :保存每个内核的唯一标识符。

4siblings :列出了位于相同物理封装中的逻辑处理器的数量。

5cpu cores :包含位于相同物理封装中的内核数量。

6)如果处理器为英特尔处理器,则 vendor id 条目中的字符串是 GenuineIntel

 

拥有相同 physical id 的所有逻辑处理器共享同一个物理插座 每个 physical id 代表一个唯一的物理封装。Siblings 表示位于这一物理封装上的逻辑处理器的数量。逻辑处理器可能支持也可能不支持超线程(HT)技术。每个 core id 均代表一个唯一的处理器内核。所有带有相同 core id 的逻辑处理器均位于同一个处理器内核上。如果有一个以上逻辑处理器拥有相同的 core id physical id,则说明系统支持超线程(HT)技术。如果有两个或两个以上的逻辑处理器拥有相同的 physical id,但是 core id 不同,则说明这是一个多内核处理器。cpu cores 条目也可以表示是否支持多内核。

 

 

一. i386 i586 i686 之间的区别

他们指的是适用于intel i386 i586i686 兼容指令集的微处理器。一般来说,等级愈高的机器可接受较低等级的rpm文件。

i386—几乎所有的X86平台,不论是旧的pentum或者是新的pentum-IVK7系统CPU,都可以正常工作,i指得是Intel兼容的CPU,至于386就是CPU的等级。

i586—就是586等级的计算机,包括pentum第一代MMX CPUAMDK5K6系统CPUsocket7插脚)等CPU都是这个等级。

i686—pentum 2 以后的Intel系统CPUK7以后等级的CPU都属于这个686等级。
你可以透过/proc/cpuinfo这个档案查询你的CPU等级。

 

 

二. 查看CPU 信息

 

我们可以通过/proc/cpuinfo 这个文件来查看CPU 的信息。

 

[root@qs-wgdb-1 proc]# more /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz

stepping        : 2

cpu MHz         : 2527.071

cache size      : 12288 KB

physical id     : 1

siblings        : 8

core id         : 0

cpu cores       : 4

apicid          : 32

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dt

s acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni

 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

bogomips        : 5054.14

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: [8]

 

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz

stepping        : 2

cpu MHz         : 2527.071

cache size      : 12288 KB

physical id     : 0

siblings        : 8

core id         : 0

cpu cores       : 4

apicid          : 0

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dt

s acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni

 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

bogomips        : 5054.02

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: [8]

 

processor       : 2

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz

stepping        : 2

cpu MHz         : 2527.071

cache size      : 12288 KB

physical id     : 1

siblings        : 8

core id         : 1

cpu cores       : 4

apicid          : 34

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dt

s acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni

 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

bogomips        : 5054.04

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: [8]

 

….

 

processor       : 14

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz

stepping        : 2

cpu MHz         : 2527.071

cache size      : 12288 KB

physical id     : 1

siblings        : 8

core id         : 10

cpu cores       : 4

apicid          : 53

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

bogomips        : 5054.03

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: [8]

 

processor       : 15

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz

stepping        : 2

cpu MHz         : 2527.071

cache size      : 12288 KB

physical id     : 0

siblings        : 8

core id         : 10

cpu cores       : 4

apicid          : 21

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

bogomips        : 5053.98

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management: [8]

 

 

 

三. 相关分析

 

3.1 查看服务器位数

[root@qs-wgdb-1 proc]# arch

x86_64

 

x86_64 64位系统

X8632位系统

 

3.2 查看CPU 是否支持64bit

[root@qs-wgdb-1 proc]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

16

 

结果大于0, 说明支持64bit计算. lmlong mode, 支持lm则是64bit

 

3.3 逻辑CPU个数:
[root@qs-wgdb-1 proc]# cat /proc/cpuinfo | grep 'processor' | wc -l

16

 

注意:这里是逻辑CPU 就是我们在cpuinfo中看到的processor.

 

 

3.4 物理CPU个数:

[root@qs-wgdb-1 proc]# cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l

2

 

这里指的是物理CPU,就是我们在服务器上看到的2CPU 插槽。

 

 

3.5 每个物理CPUCore的个数:
[root@qs-wgdb-1 proc]# cat /proc/cpuinfo | grep 'cpu cores' | wc -l

16

 

3.6 是否为超线程:

如果有两个逻辑CPU具有相同的”core id”,那么超线程是打开的。每个物理CPU中逻辑CPU(可能是core, threadsboth)的个数.


[root@qs-wgdb-1 proc]# cat /proc/cpuinfo | grep 'siblings'

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

siblings        : 8

 

 

 

四. CPU ID

 

CPU IDCPU生产厂家为识别不同类型的CPU,而为CPU制订的不同的单一的代码;不同厂家的CPU,其CPU ID定义也是不同的;如 “0F24”Inter处理器)、“681H”AMD处理器),根据这些数字代码即可判断CPU属于哪种类型,这就是一般意义上的CPU ID 

于计算机使用的是十六进制,因此CPU ID也是以十六进制表示的。Inter处理器的CPU ID一共包含四个数字,如“0F24”,从左至右分别表示 Type(类型)、Family(系列)、Mode(型号)和Stepping(步进编号)。

CPUID“068X”的处理器开始,Inter另外增 加了Brand ID(品种标识)用来辅助应用程序识别CPU的类型,因此根据“068X”CPUID还不能正确判别PentiumCelerom处理 器。必须配合Brand ID来进行细分。

AMD处理器一般分为三位,如“681”,从左至右分别表示为Family(系列)、Mode(型号)和 Stepping(步进编号)。 

 

 

Type(类型) 

类型标识用来区别INTEL微处理器是用于由最终用户安装,还是由专业个人计算机系 统集成商、服务公司或制作商安装;数字“1”标识所测试的微处理器是用于由用户安装的;数字“0”标识所测试的微处理器是用于由专业个人计算机系统集成 商、服务公司或制作商安装的。我们通常使用的INTEL处理器类型标识都是“0”“0F24”CPUID就属于这种类型。

 

Family(系列) 

系列标识可用来确定处理器属于那一代产品。如6系列的INTEL处理器包括Pentium ProPentium II Pentium II XeonPentium IIIPentium III Xeon处理器。5系列(第五代)包括Pentium处理器和采用 MMX技术的Pentium处理器。AMD6系列实际指有K7系列CPU,有DURONATHION两大类。最新一代的 INTEL Pentium 4系列处理器(包括相同核心的Celerom处理器)的系列值为“F” 

 

Mode(型号) 

型号标识可用来 确定处理器的制作技术以及属于该系列的第几代设计(或核心),型号与系列通常是相互配合使用的,用于确定计算机所安装的处理器是属于某系列处理器的哪种特 定类型。如可确定Celerom处理器是Coppermine还是Tualutin核心;Athlon XP处理器是Paiomino还是 Thorouhgbred核心。 

 

Stepping(步进编号) 

步进编号用来标识处理器的设计或制作版本,有助于控制和跟踪处理器的更 改,步进还可以让最终用户更具体地识别其系统安装的处理器版本,确定微处理器的内部设计或制作特性。步进编号就好比处理器的小版本号,如CPUID “686”“686A”就好比WINZIP8.08.1的关系。步进编号和核心步进是密切联系的。如CPUID“686”Pentium III 处理器是cCO核心,而“686A”表示的是更新版本cD0核心。 

 

Brand ID(品种标识) 

INTELCoppermine核心的处理器开始引入Brand ID作为CPU的辅助识别手段。如我们通过Brand ID可以识别出处理器究竟是Celerom还是Pentium 4

 

 

 

总结:

       /proc/cpuinfo 这个文件,我们可以看出cpu的信息。 这个有2个概念。 一个是物理CPU个数和逻辑CPU 个数。 物理CPU 就是我们在主板上卡槽看到CPU的个数。 这个可以通过physical id 这个进行判断。 有几个不同的physical id 就有几个物理CPU 至于逻辑CPU 个数,我们可以通过processor来判断。 这个比较简单。 如果有2个物理封装的的CPU,有16个逻辑CPU 那么每个物理封装里面就有8个逻辑CPU

 

 

 

整理自网络

------------------------------------------------------------------------------

QQ: 492913789
Email:ahdba@qq.com
Blog:http://www.cndba.cn/dave

网上资源: http://tianlesoftware.download.csdn.net

相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx

DBA1 群:62697716(); DBA2 群:62697977()

DBA3 群:62697850   DBA 超级群:63306533;    

聊天 群:40132017

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
可以使用以下命令查看Linux CPU的厂商信息: 1. 使用lscpu命令查看: lscpu命令可以显示CPU的详细信息,包括厂商信息、架构、核心数等等。 命令:lscpu 示例输出: ``` Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 158 Model name: Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz Stepping: 9 CPU MHz: 2700.000 BogoMIPS: 5400.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K ``` 可以看到,Vendor ID显示的是CPU厂商信息,这里是GenuineIntel,表示是英特尔的CPU。 2. 使用cat /proc/cpuinfo命令查看: cat /proc/cpuinfo命令可以显示CPU的详细信息,包括厂商信息、型号、频率等等。 命令:cat /proc/cpuinfo 示例输出: ``` processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 158 model name : Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz stepping : 9 cpu MHz : 2700.000 cache size : 6144 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves ibrs_enhanced tpr_adjust md_clear flush_l1d bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs bogomips : 5400.00 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: ``` 可以看到,vendor_id显示的是CPU厂商信息,这里也是GenuineIntel,表示是英特尔的CPU

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值