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的系统维护中 ...
随机推荐
- c#操作oracle的通用类
using System;using System.Collections;using System.Collections.Generic;using System.Data;using Syste ...
- php中的PHP_EOL换行符
看手册时发现PHP_EOL这个变量,查了下资料,原来是相当于换行符 在unix系列用 \n 在windows系列用 \r\n 在mac用 \r PHP中可以用PHP_EOL来替代,以提高代码的源代 ...
- HTML与DOM BOM javascript
1.什么是DOM? 简单说就是DOM规定了HTML,XML等的一些文档映射规范,使JavaScript可以根据这些规范来进行获取元素,在元素上进行各种操作,使得用户页面可以动态的变化,从而大大使页面的 ...
- 删除sql计划 调用的目标发生了异常。 (mscorlib) 其他信息: 用户 'sa' 登录失败。
在删除以前创建的sql的计划任务时,弹出如题错误提示,发现错误原因在于,sa密码更改过,导致在删除时因为sa的密码和当前的密码不正确出现此错误. 解决办法: 1.在计划任务的编辑窗口,找到管理连接 2 ...
- iperf linux版本移植到android (使用工具链方式不是使用Android.mk)
由于很多程序是用makefile编译linux应用程序的,如果移植到android就要重新写Android.mk,对于不熟悉这个的人来说,特别麻烦,所以这里介绍只修改makefile就能移植到andr ...
- error: invalid 'asm': invalid operand for code 'w'
google 出结果 http://stackoverflow.com/questions/15623609/including-curl-into-the-android-aosp ........ ...
- Checking the Calendar
Checking the Calendar time limit per test 1 second memory limit per test 256 megabytes input standar ...
- @property(nonatomic) UIViewAutoresizing autoresizingMask;
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum ...
- C --> OC with RunTime
前言 本来打算写一篇关于runtime的学习总结,无奈长篇大论不是我的风格,就像写申论一样痛苦,加之网上关于tuntime的文章多如牛毛,应该也够童子们学习的了,今天就随便聊聊我的理解吧. runti ...
- cell reuse & disposebag
For my project I've made base cell class TableViewCell: UITableViewCell { private(set) var disposeBa ...