Linux下查看系統CPU個數、核心數、線程數

1.查看物理CPU個數vim

(env) root@vmware01:~# grep 'physical id' /proc/cpuinfo 
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
(env) root@vmware01:~# grep 'physical id' /proc/cpuinfo | sort -u
physical id    : 0
(env) root@vmware01:~# 

2.查看核心數量服務器

 

(env) root@vmware01:~# grep 'core id' /proc/cpuinfo | sort -u |wc -l
4
(env) root@vmware01:~# grep 'core id' /proc/cpuinfo |wc -l
8
(env) root@vmware01:~# 

 

3.查看線程數ui

 

(env) root@vmware01:~# grep 'processor' /proc/cpuinfo | sort -u | wc -l
8
(env) root@vmware01:~# grep 'processor' /proc/cpuinfo |  wc -l
8
(env) root@vmware01:~# 

 

示例:spa

(env) root@vmware01:~# grep 'physical id' /proc/cpuinfo 
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
physical id    : 0
(env) root@vmware01:~# grep 'core id' /proc/cpuinfo |wc -l
8
(env) root@vmware01:~# grep 'processor' /proc/cpuinfo |  wc -l
8
(env) root@vmware01:~# 

上邊這臺服務器能夠看到有8個CPU,8個核心,每一個核心8個線程,共8×8×8=512個線線程

 查看CPU相關信息code

(env) root@vmware01:~# vim /proc/cpuinfo 
(env) root@vmware01:~# 
相關文章
相關標籤/搜索