linux下查看cpu物理个数和逻辑个数 - chw1989的专栏 - 博客频道 - CSDN.NET
body
{
font-family: 微软雅黑,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLiU,serif;
font-size: 10.5pt;
line-height: 1.5;
}
html, body
{
}
h1 {
font-size:1.5em;
font-weight:bold;
}
h2 {
font-size:1.4em;
font-weight:bold;
}
h3 {
font-size:1.3em;
font-weight:bold;
}
h4 {
font-size:1.2em;
font-weight:bold;
}
h5 {
font-size:1.1em;
font-weight:bold;
}
h6 {
font-size:1.0em;
font-weight:bold;
}
img {
border:0;
max-width: 100%;
height: auto !important;
}
blockquote {
margin-top:0px;
margin-bottom:0px;
}
table {
border-collapse:collapse;
border:1px solid #bbbbbb;
}
td {
border-collapse:collapse;
border:1px solid #bbbbbb;
}
linux下查看cpu物理个数和逻辑个数 - chw1989的专栏 - 博客频道 - CSDN.NET
- hadoop@chw-desktop3:~$ cat /proc/cpuinfo
- processor : 0
- vendor_id : GenuineIntel
- cpu family : 15
- model : 2
- model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
- stepping : 9
- microcode : 0x17
- cpu MHz : 2992.615
- cache size : 512 KB
- physical id : 0
- siblings : 2
- core id : 0
- cpu cores : 1
- apicid : 0
- initial apicid : 0
- fdiv_bug : no
- hlt_bug : no
- f00f_bug : no
- coma_bug : no
- fpu : yes
- fpu_exception : yes
- cpuid level : 2
- wp : yes
- flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr
- bogomips : 5985.23
- clflush size : 64
- cache_alignment : 128
- address sizes : 36 bits physical, 32 bits virtual
- power management:
- processor : 1
- vendor_id : GenuineIntel
- cpu family : 15
- model : 2
- model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
- stepping : 9
- microcode : 0x17
- cpu MHz : 2992.615
- cache size : 512 KB
- physical id : 0
- siblings : 2
- core id : 0
- cpu cores : 1
- apicid : 1
- initial apicid : 1
- fdiv_bug : no
- hlt_bug : no
- f00f_bug : no
- coma_bug : no
- fpu : yes
- fpu_exception : yes
- cpuid level : 2
- wp : yes
- flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr
- bogomips : 5990.44
- clflush size : 64
- cache_alignment : 128
- address sizes : 36 bits physical, 32 bits virtual
- power management:
hadoop@chw-desktop3:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 9
microcode : 0x17
cpu MHz : 2992.615
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr
bogomips : 5985.23
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management: processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 9
microcode : 0x17
cpu MHz : 2992.615
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr
bogomips : 5990.44
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:
输入命令cat /proc/cpuinfo 查看physical id有几个,上述结果显示只有0,所以只有一个物理cpu;查看processor有几个,上述结果显示有0和1两个,所以有两个逻辑cpu。
(一)概念
① 物理CPU
实际Server中插槽上的CPU个数
物理cpu数量,可以数不重复的 physical id 有几个
② 逻辑CPU
/proc/cpuinfo 用来存储cpu硬件信息的
信息内容分别列出了processor 0 –processor n 的规格。这里需要注意,n是逻辑cpu数
一般情况,我们认为一颗cpu可以有多核,加上intel的超线程技术(HT), 可以在逻辑上再分一倍数量的cpu core出来
逻辑CPU数量=物理cpu数量 x cpu cores 这个规格值 x 2(如果支持并开启ht)
备注一下:Linux下top查看的CPU也是逻辑CPU个数
③ CPU核数
一块CPU上面能处理数据的芯片组的数量、比如现在的i5 760,是双核心四线程的CPU、而 i5 2250 是四核心四线程的CPU
一般来说,物理CPU个数×每颗核数就应该等于逻辑CPU的个数,如果不相等的话,则表示服务器的CPU支持超线程技术
㈡ 查看CPU信息
当我们 cat /proc/cpuinfo 时、
具有相同core id的CPU是同一个core的超线程
具有相同physical id的CPU是同一个CPU封装的线程或核心
㈢ 下面举例说明
① 查看物理CPU的个数
#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
2
② 查看逻辑CPU的个数
#cat /proc/cpuinfo |grep "processor"|wc -l
24
③ 查看CPU是几核
#cat /proc/cpuinfo |grep "cores"|uniq
6
我这里应该是2个Cpu,每个Cpu有6个core,应该是Intel的U,支持超线程,所以显示24
linux下查看cpu物理个数和逻辑个数 - chw1989的专栏 - 博客频道 - CSDN.NET的更多相关文章
- 查看数量linux下查看cpu物理个数和逻辑个数
首先声明,我是一个菜鸟.一下文章中出现技术误导情况盖不负责 hadoop@chw-desktop3:~$ cat /proc/cpuinfo processor : 0 vendor_id : Gen ...
- linux下查看cpu物理个数和逻辑个数
hadoop@chw-desktop3:~$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 ...
- linux下查看cpu物理个数、核数、逻辑cpu数
一.首先要明确物理cpu个数.核数.逻辑cpu数的概念 1.物理cpu数:主板上实际插入的cpu数量,可以数不重复的 physical id 有几个(physical id) 2.cpu核数:单块CP ...
- Linux下 查看CPU信息
参考: Linux和Windows下查看cpu和core个数 Linux下 查看CPU信息 1.查看完整CPU信息: $ cat /proc/cpuinfo 2.查看逻辑cpu个数: $ cat /p ...
- Linux下查看CPU信息、机器型号等硬件信息命令
Linux下查看CPU信息.机器型号等硬件信息命令 编写一个bash脚本: vim info.sh #!/bin/bash cat /etc/issue echo "____________ ...
- linux权限---【600,644,700,755,711,666,777】 - - 博客频道 - CSDN.NET
body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...
- Ubuntu下deb包的安装方法 - kevinhg的博客 - 博客频道 - CSDN.NET
Ubuntu下deb包的安装方法 - kevinhg的博客 - 博客频道 - CSDN.NET dpkg -i
- Linux下查看CPU和内存(很详细)
在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...
- 【转载】Linux下查看CPU、内存占用率
不错的文章(linux系统性能监控--CPU利用率):https://blog.csdn.net/ctthuangcheng/article/details/52795477 在linux的系统维护中 ...
随机推荐
- Google 分布式关系型数据库 F1
F1是Google开发的分布式关系型数据库,主要服务于Google的广告系统.Google的广告系统以前使用MySQL,广告系统的用户经常需要使用复杂的query和join操作,这就需要设计shard ...
- table导出到excel的两种方法
1. 用table2excel 的js文件,这种方法没有IE兼容性 需要在文件中导入 <script type="text/javascript" src="< ...
- VMware 全虚拟打开
1.修改.vmx 文件,最后一行加入: hypervisor.cpuid.v0 = “FALSE" mce.enable = “TRUE" vhv.enable = “TRUE&q ...
- CLR 无法从 COM
上下文 0x50ece80 转换为 COM 上下文 0x50ecf38,这种状态已持续 60 秒.拥有目标上下文/单元的线程很有可能执行的是非泵式等待或者在不发送 Windows 消息的情况下处理一个 ...
- Django Template模板
Django Template 你可能已经注意到我们在例子视图中返回文本的方式有点特别. 也就是说,HTML被直接硬编码在 Python 代码之中. 下面我们来调用html views def ind ...
- seo优化 标点符号
一.顿号“.” 顿号是一个只有在中文中使用的标点符号,这在英文中没有.毕竟该不该在标题中使用顿号呢,建议大家仍是不要使用,或者说在标题中就不要泛起中文的符号最好.不外,顿号可以使用在Descripti ...
- Error configuring application listener of class 报错 解决
Error configuring application listener of class 次错误是由于工程没有贬义Class文件造成的,clean一下编译一下工程,clean之后进入项目目录查看 ...
- 1.1 selenium 安装
1.在火狐浏览器的附加组件里搜索Selenium IDE
- linux命令:find详解
Linux中find命令常见用法示例: find path -option [-print] [ -exec -ok command ] {} \; #-print 将查找到的文件输出到标准输出#-e ...
- Linux试题及答案
一. 单选题: 1.添加一条静态路由,使到网络196.199.3通过eth2接口出去,用: A. route add -net 196.199.3.0 B. route add -net 196.19 ...