Solved

Linux : total number of cores on a system

Posted on 2013-06-21
15
337 Views
Last Modified: 2013-07-08
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
0
Comment
Question by:royjayd
  • 7
  • 7
15 Comments
 
LVL 87

Expert Comment

by:rindi
ID: 39266272
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.
0
 

Author Comment

by:royjayd
ID: 39266306
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 ?
0
 

Author Comment

by:royjayd
ID: 39266350
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.
0
 
LVL 87

Expert Comment

by:rindi
ID: 39266400
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.
0
 

Author Comment

by:royjayd
ID: 39266415
ok thanks
Any comments on my post : ID: 39266350
0
 
LVL 87

Expert Comment

by:rindi
ID: 39266455
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.
0
 

Author Comment

by:royjayd
ID: 39266470
>>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.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 87

Expert Comment

by:rindi
ID: 39266498
That the x3675 has 6 cores is pure coincidence.
0
 

Author Comment

by:royjayd
ID: 39266527
>>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.
0
 
LVL 87

Expert Comment

by:rindi
ID: 39266696
The coincidence is that it has 6 cores and that lscpu mentions CPU family 6.
0
 

Author Comment

by:royjayd
ID: 39266789
ok.
so overall there are 2 CPUS with 6 cores in each
so 12 cores all together in my system,
am i correct ?
0
 
LVL 87

Accepted Solution

by:
rindi earned 375 total points
ID: 39266850
I don't know. To get the actual hardware of your PC you'll have to look at the Host OS, and not the VM's running within that host. Many servers also include a management module (iDRAC if it is a Dell, or ILO on HP's) that will also give you that info.
0
 

Author Comment

by:royjayd
ID: 39267075
$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
0
 
LVL 87

Expert Comment

by:rindi
ID: 39267148
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.
0
 
LVL 27

Expert Comment

by:serialband
ID: 39267175
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.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now