环境

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 4

问题

  • 可以运行什么命令来打印系统上的CPU插槽数量?

决议

  • 要准确确定系统上的CPU插槽数量而不进行物理打开和手动检查,必须依赖系统的DMI表(由BIOS填充)。安装dmidecode包(如有必要),然后以root用户身份运行以下命令

     
    # dmidecode -t4 | grep Socket.Designation: | wc -l
    2

     

    警告:由于固件或BIOS出现问题,有些情况下dmidecode报告的结果不正确。如果您怀疑dmidecode的输出不正确,请务必更新您的BIOS和其他相关固件。

  • 如果系统上的所有CPU插槽都已填满(即每个插槽中都有一个处理器),则以普通用户身份执行以下任何操作就足够了:

    • 查阅 /proc/cpuinfo文件,例如:

       
      $ grep physical.id /proc/cpuinfo | sort -u | wc -l
      2

       

    • RHEL6及以上版本:使用lscpu命令,例如:

       
      $ lscpu | grep -i "socket(s)"
      2

       

    • RHEL6及更高版本:使用hwloc包提供的lstopo命令,例如:

       
      $ lstopo --whole-system --only Socket

       

  • 相关:如何查找物理cpu,cpu核心和逻辑cpu的数量

 

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2021-12-08
  • 2021-05-13
  • 2021-07-03
  • 2022-12-23
  • 2023-03-15
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-02-20
相关资源
相似解决方案