2
Linux下查看处理器是几核几线程
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.
- ubuntu 18.04 64bit
-
cpu
个数是指物理上的个数
-
cpu
核心数也是物理上的,即硬件上存在多少个核心,比如常说的双核就是指2个核心
-
cpu
线程数这是指逻辑上的。也就是能模拟出的
cpu
核心数,比如使用超线程技术,就能够模拟出多于cpu
核心数的线程
linux如何查看
在 Linux
下,处理器信息都是存放在文件 /proc/cpuinfo
内,因此,要得到 cpu
的具体数据,就要去解析这个文件
# 解析cpu个数
cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
# 解析cpu核心数
cat /proc/cpuinfo | grep "core id" | sort -u | wc -l
# 解析线程数
cat /proc/cpuinfo | grep "processor" | sort -u | wc -l
所以,我目前的这台服务器,就只有1个 cpu
,每个 cpu
拥有4个核心,每个核心只有1个线程。
喜欢 (0)分享 (0)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK