LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How many CPUs I have ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-many-cpus-i-have-4175547573/)

bangnagr 07-09-2015 02:07 AM

How many CPUs I have ?
 
Hi all

This para is from book - 'Troubleshooting Linux Server Best Practices', describing load average in uptime command.

"A single-CPU system with a load average of 1 means the single CPU is under constant load. If that single-CPU system has a load average of 4, there is four times the load on the system than it can handle, so three out of four processes are waiting for resources. The load average reported on a system is not tweaked based on the number of CPUs you have, so if you have a two-CPU system with a load average of 1, one of your two CPUs is loaded at all times — that is, you are 50% loaded. So a load of 1 on a single-CPU system is the same as a load of 4 on a four-CPU system in terms of the amount of available resources used."

In this, when he says 1 CPU, is he referring to a physical CPU or Cores ?

I'm confused, in my system I have 1 physical CPU (Intel Core2Duo E7500) with 2 cores. A load of 1 in my system is 100% or 50% ? I have also seen servers with 2 physical CPUs (or processors :confused:)

My system output:
Code:

# lscpu
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:    2
Socket(s):            1
NUMA node(s):          1
Vendor ID:            GenuineIntel
CPU family:            6
Model:                23
Model name:            Intel(R) Core(TM)2 Duo CPU    E7500  @ 2.93GHz
Stepping:              10
CPU MHz:              1600.000
CPU max MHz:          2933.0000
CPU min MHz:          1600.0000
BogoMIPS:              5866.29
Virtualization:        VT-x
L1d cache:            32K
L1i cache:            32K
L2 cache:              3072K
NUMA node0 CPU(s):    0,1

# nproc
2

Is single core considered as one CPU ?

Thank you

Vernicronz 07-09-2015 03:10 AM

Hi ,

this article will help you better :)

http://www.howtogeek.com/194756/cpu-...ing-explained/

syg00 07-09-2015 03:13 AM

Quote:

Originally Posted by bangnagr (Post 5389130)
Code:

CPU(s):                2

When in doubt believe what the kernel is telling you.
Quote:

Is single core considered as one CPU ?
Yes.

The author of that article is wrong about how loadavg should be interpreted - this is a common fallacy on the web also. In Linux, the loadavg includes tasks in uniterruptible sleep - usually waiting on disk I/O. This can cause the loadavg to increase without having any demand or effect on CPU usage.

rtmistler 07-09-2015 07:22 AM

They're referring to cores and they wrote about that topic in a very confusing manner. They'd have been better off just copying from the uptime manual page instead of wherever they got that or rewrote it.

jpollard 07-11-2015 07:15 AM

Quote:

Originally Posted by bangnagr (Post 5389130)
Hi all

Is single core considered as one CPU ?

Thank you

The definition of a CPU (Central Processing Unit) is that part of the hardware that incorporates the instruction cycle, which carries out the processing part.

The fact that vendors started mixing "cpu" for their product containing multiple cpus is a marketing issue. The technical definition of CPU hasn't changed.

Each core is a CPU.

Chad-Bayne 07-13-2015 06:03 PM

@ bangnagr

Code:

egrep -i "cores|siblings" /proc/cpuinfo
This should give you the number of physical cores and virtual threads.

If the siblings equal the number of cpu cores, than hyper threading is disabled in the BIOS or is not available for the CPU.

Here is an example of mine.

siblings : 4
cpu cores : 2
siblings : 4
cpu cores : 2
siblings : 4
cpu cores : 2
siblings : 4
cpu cores : 2

On my system, I have two physical cores with 4 siblings. So this means that hyperthreading is enabled and my system acts like a quad core.


All times are GMT -5. The time now is 06:33 PM.