Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find the number of CPUs in a Linux box? 3

Status
Not open for further replies.

murali2104

Technical User
Jul 6, 2005
43
IN
Hi,
we have a Dell power edge 2850 server(Xeon) on which SUSE linux 9 (64 bit) is loaded.

What is the command to fine out the number of CPUs?
1. EJMJMO1:~ # cat /proc/cpuinfo | grep processor
processor : 0
Does this mean it is sinle processor?
2. From windwos vista loaded on the similar machine
it shows
Processor:Intel(R) Xeon(TM)CPU 3.00 GHZ 2.99 GHZ(2 processors)

3.What is the exact command for this?
 
4. I tried also the following script
numProcs=`cat /proc/cpuinfo | awk '/^ *processor *:/ {count++} END { print count }'`

Buut the output is BLANK.
 
It is a single processor with hyperthreading, so it can be seen as two virtual processors, depending on which kernel (or operating system) you are running. What is the output of uname -r, and cat /proc/cpuinfo?

I believe if you install the smp kernel you will see 2 processors...

Annihilannic.
 
I Just want to know the number of physical processors.


GUTHULA:/#uname -r
2.6.5-7.97-default
GUTHULA:/#cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 1
cpu MHz : 2992.796
cache size : 1024 KB
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 syscall nx lm pni monitor
ds_cpl cid cmpxchg16b
bogomips : 5947.39
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 48 bits virtual
power management:

GUTHULA:/#
 

GUTHULA:/#dmidecode | grep -c Central
2

Does this mean it has TWO processors?
 
Hmm... yes it would seem so, in which case you should definitely be running the SMP kernel to make use of them.

Annihilannic.
 
If it has 2 processors, we are going to reload Windows 2003/2000 OS. So that SMP does not matter much.
The application that we are going to test had a minimum sys requirement of 2 Processors with 4GB of RAM.

So before reloading the OS, and installing the application we would like to confirm if this had 2 processors?

Thanks
Murali
 
Yes, it has. Examine the output of dmidecode, you should see one processor in Socket Designation "PROC_1" and another in Socket Designation "PROC_2".

Annihilannic.
 
The definitive answer would be to goto Dell's site and lookup the Service Tag on that 2850. The lookup will tell you exactly what left the Dell assy plant.
 
i would just open the case and take a look... more than likely it has a single processor using ht. Your seeing the 1 physical processor and winblows says there is 2 because that is what it is meant to think.

 
Annihilannic,

I don't think that's correct.

Code:
foxtrot(~)$ sudo dmidecode | grep -c Central
2

I definitely only have a single processor with a single core, and since it's a Sempron, I'm pretty sure it doesn't have HyperThreading.

My motherboard is capable of using a dual core athlon, I think that's what dmidecode is reading. I'm not a big hardware guru, so please correct me if I'm wrong.

Code:
Handle 0x0004, DMI type 4, 32 bytes.
Processor Information
        Socket Designation: Socket 939
        Type: Central Processor
        Family: Sempron
        Manufacturer: AMD
        ID: F0 0F 01 00 FF FB 8B 07
        Signature: Extended Family 0, Extended Model 1, Stepping 0
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                MMX (MMX technology supported)
                FXSR (Fast floating-point save and restore)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
        Version: AMD Sempron(tm) Processor 3000+
        Voltage: 1.4 V
        External Clock: 201 MHz
        Max Speed: 3000 MHz
        Current Speed: 1810 MHz
        Status: Populated, Enabled
        Upgrade: <OUT OF SPEC>
        L1 Cache Handle: 0x000B
        L2 Cache Handle: 0x000D
        L3 Cache Handle: No L3 Cache

Handle 0x0005, DMI type 4, 32 bytes.
Processor Information
        Socket Designation: Socket 939
        Type: Central Processor
        Family: Unknown
        Manufacturer: Unknown
        ID: 00 00 00 00 00 00 00 00
        Version: AMD Sempron(tm) Processor 3000+
        Voltage: 1.4 V
        External Clock: 201 MHz
        Max Speed: 3000 MHz
        Current Speed: 1810 MHz
        Status: Populated, Disabled By User
        Upgrade: <OUT OF SPEC>
        L1 Cache Handle: 0x000C
        L2 Cache Handle: 0x000E
        L3 Cache Handle: No L3 Cache

 
Hi Eric,

Obviously not correct in your case, but I was trying it on an identical PowerEdge 2850 system so the result should be the same.

It's strange that your motherboard is reporting a 'current speed' for a non-existent processor... I wouldn't be surprised to see it reporting the presence of the slot, but nothing about the non-existent processor in the slot!

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top