【Linux】查看物理CPU個數、核數、邏輯CPU個數

①物理cpu數:主板上實際插入的cpu數量,能夠數不重複的 physical id 有幾個(physical id)

cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
②cpu核數:單塊CPU上面能處理數據的芯片組的數量,如雙核、四核等 (cpu cores)

cat /proc/cpuinfo| grep "cpu cores"| uniq
③邏輯cpu數:簡單來講,它可以使處理器中的1顆內核,如2顆內核那樣在操做系統中發揮做用。

cat /proc/cpuinfo| grep "processor"| wc -l
④查看cpu信息(型號)

cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
xxxx@ubuntu:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:          64391       12022        1280          20       51087       51664
Swap:         15258         510       14748
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
2
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores   : 10
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "processor" | wc -l
40
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
     40  Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
總核數 = 物理CPU個數 × 每顆物理CPU的核數;
總邏輯CPU數 = 物理CPU個數 ×每顆物理CPU的核數 × 超線程數。

結論:因此這算雙核的。
相關文章
相關標籤/搜索