Wednesday 26 February 2014

Number of cores on HP DL 560 g8 on Linux explained!

Recently we both new HP servers! HP DL 560p gen8! Brilliant machine! Lots of RAM, lots of CPU power!

We installed SLES 11.3 x64 to give it a try!

I knew how many CPU sockets are they but I didn't know how many cores are there per socket so I run following command

 # cat /proc/cpuinfo

and saw that number of last cpu have number

processor       : 63

My thinking was this: Ok, so we have 64 cores, that is 64/4=16 cores per sockets!!!
Pretty impressive, don't you think?!?

I wanted to read more about CPU on Internet.

CPU is

model name      : Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz

http://ark.intel.com/products/64603/Intel-Xeon-Processor-E5-4640-20M-Cache-2_40-GHz-8_00-GTs-Intel-QPI

But there was that this is 8 core CPU.

# of Cores 8

Hm..... something is not right here.

Think that maybe, just maybe Intel make mistake and that in fact this is 16 core CPU is highly unlikely so this must be Linux issue.

After some reading I realise this. In processor info there was this parameter

# of Threads 16

And 16*4=64.


Little explanation first:
 core vs thread

A thread is a single line of commands that are getting processed. A core is the physical hardware that works on the thread. In general a processor can only work on one thread per core, CPUs with hyper threading can work on up to two threads per core.
 
So this CPU has 16 treads for 8 cores and Linux kernel see this as number of cores, that is he see 16 cores instead of 8 cores. So Linux is reading number of threads!!!

How to get actual number of cores from CLI?

Number of sockets:
#cat /proc/cpuinfo |grep "physical id"|sort|uniq
physical id     : 0
physical id     : 1
physical id     : 2
physical id     : 3



Number of cores per socket
#cat /proc/cpuinfo |grep "cpu cores"|uniq
cpu cores       : 8

So 4 sockets with 8 cores per sockets equals 32 cores.
 

No comments: