Find out CPU, Sockets & Cores

Posted on August 18, 2016

0


Environment

OS = Redhat Enterprise Linux

Version = 5.9

Find out total CPUs & Sockets

dmidecode |grep -i cpu

Example output:

dmidecode |grep -i cpu
Version: Intel(R) Xeon(R) CPU E5530 @ 2.40GHz
Version: Intel(R) Xeon(R) CPU E5530 @ 2.40GHz

Description

Above command output shows total sockets i.e., 2 and total CPU/processors installed i.e., 2

OR

Find out total Sockets

cat /proc/cpuinfo | grep “physical id” | sort -u | wc -l

Example output:

2

Description

The example output confirms that 2 sockets exist on machine

 

Find out total Cores

egrep -e “core id” -e ^physical /proc/cpuinfo|xargs -l2 echo|sort -u

Example output:

physical id : 0 core id : 0
physical id : 0 core id : 1
physical id : 0 core id : 2
physical id : 0 core id : 3
physical id : 1 core id : 0
physical id : 1 core id : 1
physical id : 1 core id : 2
physical id : 1 core id : 3

Description

Above command output shows total CPUs i.e., Physical id 0 & Physical id 1 (means 2) and each physical id keeps 4 cores. So total cores belongs with 2 CPUs are 8.

Advertisements
Posted in: Tech News