How do I find out the number of cores I have

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
Rick_Smith
Posts: 87
Joined: 2011/10/07 11:32:23

How do I find out the number of cores I have

Post by Rick_Smith » 2013/05/01 00:18:16

I did a google search and came up with this command: cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l
2
but it looks like more than 2 cores here

[root@root]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.60GHz
stepping : 3
cpu MHz : 3591.356
cache size : 2048 KB
physical id : 0
siblings : 2
runqueue : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
bogomips : 7156.53

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.60GHz
stepping : 3
cpu MHz : 3591.356
cache size : 2048 KB
physical id : 0
siblings : 2
runqueue : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
bogomips : 7156.53

processor : 2
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.60GHz
stepping : 3
cpu MHz : 3591.356
cache size : 2048 KB
physical id : 3
siblings : 2
runqueue : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
bogomips : 7156.53

processor : 3
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.60GHz
stepping : 3
cpu MHz : 3591.356
cache size : 2048 KB
physical id : 3
siblings : 2
runqueue : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
bogomips : 7156.53

I dio

User avatar
TrevorH
Forum Moderator
Posts: 28865
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

How do I find out the number of cores I have

Post by TrevorH » 2013/05/01 00:26:10

You have 2 physical cores - count the number of distinct "physical id" numbers you have. Each one of those physical cores has 2 HT threads - from "siblings: 2". So, 2 physical cores, 4 logical ones.

Rick_Smith
Posts: 87
Joined: 2011/10/07 11:32:23

Re: How do I find out the number of cores I have

Post by Rick_Smith » 2013/05/01 03:26:41

So I have two physical sockets and 4 cores? This is required for Oracle database licensing.

User avatar
TrevorH
Forum Moderator
Posts: 28865
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How do I find out the number of cores I have

Post by TrevorH » 2013/05/01 09:09:36

Actually, I cannot tell what you have! I'm not sure I was correct before about two cores, 4 threads.

hawkmage
Posts: 162
Joined: 2011/12/17 00:00:11

Re: How do I find out the number of cores I have

Post by hawkmage » 2013/05/02 02:28:02

Looking at the cpu info here is what I see:
There are physical id 0 and 3 telling me that there are 2 physical CPU Sockets.
There is no core id field so the CPU is not a multi core CPU.
It lists siblings 2 and there is the ht flag so you have a hyper-threading CPU.

This link has good info on the cpuinfo file but it is not have everything: http://www.richweb.com/cpu_info

Post Reply

Return to “CentOS 5 - Server Support”