Operating System - Linux
1829816 Members
1790 Online
109993 Solutions
New Discussion

How to find out the number of CPUs in the server

 
Adithyan
Frequent Advisor

How to find out the number of CPUs in the server

Hi,

How to find the number of Physical CPUs installed in the server from the OS.

/proc/cpuinfo will give the logical CPUs whcih are showing may be because Hyper threading/Dual core.

Pls share..

Thanks
Adityan
Keen to learn HP UX
7 REPLIES 7
Ivan Ferreira
Honored Contributor

Re: How to find out the number of CPUs in the server

Please see:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1008505
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: How to find out the number of CPUs in the server

Shalom

hwinfo should be able to provide accurate information on the number of physical cpus

Its a gui though.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Adithyan
Frequent Advisor

Re: How to find out the number of CPUs in the server

Hi Ivan,

I have gone through the posts. but no one has given a clear idea. I am attaching the output of /proc/cpuinfo, can u just figure it out ?

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5994.51

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.06

processor : 2
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 1
siblings : 2
core id : 2
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.16

processor : 3
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 1
siblings : 2
core id : 3
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.11

processor : 4
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 2
siblings : 2
core id : 4
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.82

processor : 5
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 2
siblings : 2
core id : 5
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.08

processor : 6
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 6
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5983.74

processor : 7
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 8
cpu MHz : 2995.051
cache size : 2048 KB
physical id : 3
siblings : 2
core id : 7
cpu cores : 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 mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est
cid xtpr
bogomips : 5984.85

How many CPUs are physically present in this server. I think its 2 CPUs with Dual core and HT on ???

Thanks.
Keen to learn HP UX
Alexander Chuzhoy
Honored Contributor

Re: How to find out the number of CPUs in the server

What's wrong with counting the different numbers in lines with "physical id :" in the output of `cat /proc/cpuinfo`?
In your post there are 0,1,2,3 - total of 4.
dirk dierickx
Honored Contributor

Re: How to find out the number of CPUs in the server

dmesg|grep CPU#

also does the trick.
Mike Stroyan
Honored Contributor

Re: How to find out the number of CPUs in the server

The "Multi-core and Linux Kernel" paper at
http://oss.intel.com/pdf/mclinux.pdf
discusses how to determine multi-core and hyperthreading features from the output of /proc/cpuinfo.
Hyperthreading can be checked both by looking for an 'ht' flag in the 'flags:' line and by looking for a 'siblings:' value greater than the 'cpu cores:' value.
Pattabhi
Frequent Advisor

Re: How to find out the number of CPUs in the server

Adityan,

Do a cat /proc/cpuinfo | grep physical

This will give the physical ids of the procs if there are 2 CPU's with the same phy id, then u should classify it as one, as 2 logical CPUS share the same id during hyperthreading.


Regards,
Pattabhi Raman