Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

Linux : total number of cores on a system

hi experts

My requirment is to find the total number of 'cores' in my system.

when i do
$ lscpu

This is what i see ::

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Stepping:              2
CPU MHz:               3059.000
BogoMIPS:              6118.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0,1

Does this mean 2 cpus with each CPU having 6 cores ?
Does the 'cpu family' mean cores ?

Any help will be greatly appreciated
thanks
Avatar of rindi
rindi
Flag of Switzerland image

No. It means 2 CPU's, each with one core. But as this is in VMware this is virtual and doesn't reflect the true hardware. CPU family is "stepping", something similar to CPU version.
Avatar of Jay Roy

ASKER

ok thanks

>>But as this is in VMware this is virtual and doesn't reflect the true hardware

So are you saying that it may or may not be 2 cores ?
Avatar of Jay Roy

ASKER

also you said
>>It means 2 CPU's, each with one core

Here is why i think each cpu has 6 cores

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz
stepping        : 2
cpu MHz         : 3059.000
cache size      : 12288 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse t...
bogomips        : 6118.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz
stepping        : 2
cpu MHz         : 3059.000
cache size      : 12288 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse t...
bogomips        : 6118.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

Open in new window


Next search for the model name

Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz


its points you to the model webpage ::
http://ark.intel.com/products/52577/

and it does say # of Cores  = 6


Is my understanding correct ?


thanks.
What the real CPU is in your PC I can't say. VMware, like the other hypervisors, simulates a PC to your guest OS, and that simulated PC can look completely different from the original.

If your PC's CPU has 2 cores the hypervisor is now presenting those 2 cores as 2 separate CPU's , and not as a single 2 core CPU.
Avatar of Jay Roy

ASKER

ok thanks
Any comments on my post : ID: 39266350
No. The 6 is just the version of the CPU. It hasn't got anything to do with the number of cores.Within VMware you can assign how many cores or virtual CPU's should be presented to the VM.
Avatar of Jay Roy

ASKER

>>The 6 is just the version of the CPU
Yes i got that.

what i mean is
i took the model of the CPU which is
"Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz "

and searched in google and this is what i found
http://ark.intel.com/products/52577/

Its the Intel website and in that page it says
# of Cores  6
# of Threads  12
thx.
That the x3675 has 6 cores is pure coincidence.
Avatar of Jay Roy

ASKER

>>That the x3675 has 6 cores is pure coincidence.

Dint understand what you meant there.

The model X5675  does have 6 cores right ?
Thats what the website says.
The coincidence is that it has 6 cores and that lscpu mentions CPU family 6.
Avatar of Jay Roy

ASKER

ok.
so overall there are 2 CPUS with 6 cores in each
so 12 cores all together in my system,
am i correct ?
ASKER CERTIFIED SOLUTION
Avatar of rindi
rindi
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

$uname -a
Linux r01022 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Feb 20 12:17:37 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

>>. To get the actual hardware of your PC you'll have to look at the Host OS

Is there a command  which i can do to find that?


thanks
What is your host OS? If it is VMware vSphere HyperVisor (ESXi), you should see that info from within the utility which you use to create VM's. There should be an option that shows you the hardware ESXi is running on somewhere there. Probably also the the VMware Console shows you the hardware. I can't give details as I myself don't have an ESXi server at hand.
Try:
nproc

If you have an older system without nproc, try

cat /proc/cpuinfo | grep “^processor” | wc -l

That should tell you how many CPU cores your system sees.