1. hadoop@chw-desktop3:~$ cat /proc/cpuinfo
  2. processor   : 0
  3. vendor_id   : GenuineIntel
  4. cpu family  : 15
  5. model       : 2
  6. model name  : Intel(R) Pentium(R) 4 CPU 3.00GHz
  7. stepping    : 9
  8. microcode   : 0x17
  9. cpu MHz     : 2992.615
  10. cache size  : 512 KB
  11. physical id : 0
  12. siblings    : 2
  13. core id     : 0
  14. cpu cores   : 1
  15. apicid      : 0
  16. initial apicid  : 0
  17. fdiv_bug    : no
  18. hlt_bug     : no
  19. f00f_bug    : no
  20. coma_bug    : no
  21. fpu     : yes
  22. fpu_exception   : yes
  23. cpuid level : 2
  24. wp      : yes
  25. 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
  26. bogomips    : 5985.23
  27. clflush size    : 64
  28. cache_alignment : 128
  29. address sizes   : 36 bits physical, 32 bits virtual
  30. power management:
  31. processor   : 1
  32. vendor_id   : GenuineIntel
  33. cpu family  : 15
  34. model       : 2
  35. model name  : Intel(R) Pentium(R) 4 CPU 3.00GHz
  36. stepping    : 9
  37. microcode   : 0x17
  38. cpu MHz     : 2992.615
  39. cache size  : 512 KB
  40. physical id : 0
  41. siblings    : 2
  42. core id     : 0
  43. cpu cores   : 1
  44. apicid      : 1
  45. initial apicid  : 1
  46. fdiv_bug    : no
  47. hlt_bug     : no
  48. f00f_bug    : no
  49. coma_bug    : no
  50. fpu     : yes
  51. fpu_exception   : yes
  52. cpuid level : 2
  53. wp      : yes
  54. 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
  55. bogomips    : 5990.44
  56. clflush size    : 64
  57. cache_alignment : 128
  58. address sizes   : 36 bits physical, 32 bits virtual
  59. 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物理个数和逻辑个数的更多相关文章

  1. linux下查看cpu物理个数和逻辑个数 - chw1989的专栏 - 博客频道 - CSDN.NET

    body { font-family: 微软雅黑,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLi ...

  2. 查看数量linux下查看cpu物理个数和逻辑个数

    首先声明,我是一个菜鸟.一下文章中出现技术误导情况盖不负责 hadoop@chw-desktop3:~$ cat /proc/cpuinfo processor : 0 vendor_id : Gen ...

  3. linux下查看cpu物理个数、核数、逻辑cpu数

    一.首先要明确物理cpu个数.核数.逻辑cpu数的概念 1.物理cpu数:主板上实际插入的cpu数量,可以数不重复的 physical id 有几个(physical id) 2.cpu核数:单块CP ...

  4. Linux下 查看CPU信息

    参考: Linux和Windows下查看cpu和core个数 Linux下 查看CPU信息 1.查看完整CPU信息: $ cat /proc/cpuinfo 2.查看逻辑cpu个数: $ cat /p ...

  5. Linux下查看CPU信息、机器型号等硬件信息命令

    Linux下查看CPU信息.机器型号等硬件信息命令 编写一个bash脚本: vim info.sh #!/bin/bash cat /etc/issue echo "____________ ...

  6. Linux下查看CPU和内存(很详细)

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

  7. 【转载】Linux下查看CPU、内存占用率

    不错的文章(linux系统性能监控--CPU利用率):https://blog.csdn.net/ctthuangcheng/article/details/52795477 在linux的系统维护中 ...

  8. linux 下查看cpu信息

    linux 操作系统的位数查看 A. getconf LONG_BIT 如果是32表示是32位 B.  file /sbin/init信息全面一些 root@kali:~/software# file ...

  9. Linux下查看CPU、内存占用率

    linux下查看最消耗CPU.内存的进程 CPU占用最多的前10个进程: ps auxw|head -1;ps auxw|sort -rn -k3|head -10 内存消耗最多的前10个进程: ps ...

随机推荐

  1. 《自己动手写框架2》:用200行的DBF解析器来展示良好架构设计

    因为工作关系.须要工作其中,须要读取DBF文件.找了一些DBF读取开源软件,要么是太过庞大,动不动就上万行.要么是功能有问题,编码,长度,总之是没有找到一个很爽的. 在万般无奈之下,我老人家怒从心头起 ...

  2. MySQL (1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\xAC\\xE5\\x89...' for column 'description' at row 1")

    (1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\xAC\\xE5\\x89...' for column 'description' at ...

  3. C#基础第八天-作业-设计类-面向对象方式实现两个帐户之间转账

    要求1:完成以下两种账户类型的编码.银行的客户分为两大类:储蓄账户(SavingAccount)和信用账户(CreditAccount),两种的账户类型的区别在于:储蓄账户不允许透支,而信用账户可以透 ...

  4. [svc]jdk+tomcat部署.jforum论坛部署

    安装jdk和tomcat jdk1.7.0_13(系列)下载url 我这里用的最新的jdk. 去官网下载即可 cd /usr/local/src/ tar xf jdk-8u162-linux-x64 ...

  5. BLIST,BindingSource

    //gridControl1.DataSource = BList; //BindingSource bs = new BindingSource(); //bs.DataSource = BList ...

  6. CCShatteredTiles3D

    CCSprite* pImgBg = CCSprite::create("1.png"); pImgBg->setPosition(ccp(CCDirector::share ...

  7. pandas数组获取最大值索引的方法-argmax和idxmax

    pandas Series 的 argmax 方法和 idxmax 方法用于获取 Series 的最大值的索引值: 举个栗子: 有一个pandas Series,它的索引是国家名,数据是就业率,要找出 ...

  8. 服务器搭建5 Samba实现文件共享

    Samba服务器工作原理 客户端向Samba服务器发起请求,请求访问共享目录,Samba服务器接收请求,查询smb.conf文件,查看共享目录是否存在,以及来访者的访问权限,如果来访者具有相应的权限, ...

  9. 每日英语:The Most Destructive, Unpredictable Force in Tech

    What's the most destructive force in the tech world, the thing that has nearly killed BlackBerry, pu ...

  10. linux命令(42):tr命令

    Linux tr命令 Linux tr 命令用于转换或删除文件中的字符. tr 指令从标准输入设备读取数据,经过字符串转译后,将结果输出到标准输出设备. 语法: tr [-cdst][--help][ ...