#cat /proc/cpuinfo |grep "processor"|sort -u|wc -l
24
2.由於有超線程技術有必要查看一下物理CPU個數:
#grep "physical id" /proc/cpuinfo|sort -u|wc -l
2
#grep "physical id" /proc/cpuinfo|sort -u
physical id : 0
physical id : 1
查看每個物理CPU內核個數:
#grep "cpu cores" /proc/cpuinfo|uniq
cpu cores : 6
每個物理CPU上邏輯CPU個數:
#grep "siblings" /proc/cpuinfo|uniq
siblings : 12
判斷是否開啓了抄超線程:
如果多個邏輯CPU的"physical id"和"core id"均相同,說明開啓了超線程
或者換句話說
邏輯CPU個數 > 物理CPU個數 * CPU內核數 開啓了超線程
邏輯CPU個數 = 物理CPU個數 * CPU內核數 沒有開啓超線程