Wednesday, March 28, 2012

Linux Check CPU Sockets Cores Threads

1. number of physical processors :

# cat /proc/cpuinfo | grep "physical id" | sort -n | uniq | wc -l

2. number of cores :

# cat /proc/cpuinfo | grep "cpu cores" | uniq

3. find if ht enabled

# cat /proc/cpuinfo | grep "ht" | uniq

if u see "ht" in flags then ht is enabled

suppose cpuinfo gives u the numbers

CPUs = 24 (0 to 23 )
siblings in each CPU = 12
CPU cores in each CPU = 6

that means each CPU is hyper threading enabled.

siblings (12 ) = cores (6) x hyper-threading (2)

number of physical CPUs = 24 / 12 = 2 !

1 comment: