2

Linux下查看处理器是几核几线程

 1 year ago
source link: https://xugaoxiang.com/2023/06/24/linux-check-cpu-processor/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
  • ubuntu 18.04 64bit
  • cpu 个数

    是指物理上的个数

  • cpu 核心数

    也是物理上的,即硬件上存在多少个核心,比如常说的双核就是指2个核心

  • cpu 线程数

    这是指逻辑上的。也就是能模拟出的 cpu 核心数,比如使用超线程技术,就能够模拟出多于 cpu 核心数的线程

linux如何查看

Linux 下,处理器信息都是存放在文件 /proc/cpuinfo 内,因此,要得到 cpu 的具体数据,就要去解析这个文件



  1. # 解析cpu个数
  2. cat /proc/cpuinfo | grep "physical id" | uniq | wc -l

cpuinfo physical



  1. # 解析cpu核心数
  2. cat /proc/cpuinfo | grep "core id" | sort -u | wc -l

cpuinfo core



  1. # 解析线程数
  2. cat /proc/cpuinfo | grep "processor" | sort -u | wc -l

cpuinfo processor

所以,我目前的这台服务器,就只有1个 cpu,每个 cpu 拥有4个核心,每个核心只有1个线程。

喜欢 (0)分享 (0)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK