LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How many processors? (https://www.linuxquestions.org/questions/linux-newbie-8/how-many-processors-4175657624/)

nanscuvel 07-18-2019 09:54 AM

How many processors?
 
How do I find the number and type of processors on the server

TB0ne 07-18-2019 09:57 AM

Quote:

Originally Posted by nanscuvel (Post 6016274)
How do I find the number and type of processors on the server

Again, as with your other thread, you need to do basic research first. The /proc/cpu_info file has this.

hazel 07-18-2019 09:58 AM

How many penguins appear on the screen when you boot? That'll give you the number.

But for more detailed info about type, look at /proc/cpuinfo.

berndbausch 07-18-2019 10:39 AM

procinfo can't distinguish between cores and processors, as far as I know. A tool like dmidecode might be a better solution.

Red Hat has this to say about the subject: https://access.redhat.com/discussions/480953.

BW-userx 07-18-2019 10:47 AM

Quote:

Originally Posted by hazel (Post 6016280)
How many penguins appear on the screen when you boot? That'll give you the number.

But for more detailed info about type, look at /proc/cpuinfo.

are you serious? now I got a try counting penguins.... :D

TenTenths 07-18-2019 10:54 AM

Quote:

Originally Posted by BW-userx (Post 6016303)
are you serious? now I got a try counting penguins.... :D

Let us know if it sends you to sleep.

ehartman 07-18-2019 12:08 PM

Quote:

Originally Posted by berndbausch (Post 6016297)
procinfo can't distinguish between cores and processors, as far as I know.

No, it can't. It will treat all cores as processors.
But for most desktop (home-usage) machines, the answer is 1
As far as I know only XEON motherboards, mostly used for servers, have multiple (up to 4) CPU sockets. But, of course, it might be that by now even Core * cpu's have real multi-processor capabilities. But a "normal" Core i? (or such) motherboard only has a single cpu socket, so only a single cpu (and only a single memory controller). It can have multiple cores, of course, but a core is NOT a full separate processor (among that because of the single memory processor, so all cores have to wait on each other to get/store data from/to RAM (or even L2 cache).

BW-userx 07-18-2019 12:41 PM

lscpu
Code:

CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                  39 bits physical, 48 bits virtual
CPU(s):                          4
On-line CPU(s) list:            0-3
Thread(s) per core:              2
Core(s) per socket:              2
Socket(s):                      1
NUMA node(s):                    1


ehartman 07-18-2019 02:40 PM

Quote:

Originally Posted by BW-userx (Post 6016353)
lscpu
Code:

CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                  39 bits physical, 48 bits virtual
CPU(s):                          4
On-line CPU(s) list:            0-3
Thread(s) per core:              2
Core(s) per socket:              2
Socket(s):                      1
NUMA node(s):                    1


So this probably is a single cpu chip, with 2 cores and 2 threads per core, because I think the "Socket(s)" one gives the real number of physical cpu chips.
At least my system gives
Code:

Architecture:          i686
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
Vendor ID:            GenuineIntel
CPU family:            6
Model:                23
Stepping:              10
CPU MHz:              3066.803
BogoMIPS:              6133.12
Virtualization:        VT-x
L1d cache:            32K
L1i cache:            32K
L2 cache:              3072K

and I know it is a Core 2 Duo cpu, so a single chip with 2 cores.

Another way is
Code:

$ cat /proc/cpuinfo
(only giving the last core)
processor      : 1
vendor_id      : GenuineIntel
cpu family      : 6
model          : 23
model name      : Intel(R) Core(TM)2 Duo CPU    E7600  @ 3.06GHz
stepping        : 10
cpu MHz        : 3066.803
cache size      : 3072 KB
physical id    : 0
siblings        : 2
core id        : 1
cpu cores      : 2
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug        : no
f00f_bug        : no
coma_bug        : no
fpu            : yes
fpu_exception  : yes
cpuid level    : 13
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 pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority
bogomips        : 6133.12
clflush size    : 64
cache_alignment : 64
address sizes  : 36 bits physical, 48 bits virtual

which gives the model name of the cpu chip too.

The OP hasn't told us yet if he wants to know the real physical number of cpu's or "how many parallel instruction streams can be processed", which will include cores and thread per core too.

scasey 07-18-2019 02:44 PM

I think you all are being very helpful with the OPs homework in both of their threads.
These threads will definitely help others in the future. ;)

I for one, was pleased to learn about lscpu -- I've always just looked at Webmin's System Information page, but, of course, that requires installing and configuring Webmin

dugan 07-18-2019 02:53 PM

nproc

scasey 07-18-2019 02:55 PM

Quote:

Originally Posted by dugan (Post 6016411)
nproc

Also cool. Appears to list number of cores, yes?

hazel 07-19-2019 05:34 AM

Quote:

Originally Posted by scasey (Post 6016414)
Also cool. Appears to list number of cores, yes?

That's what it does on my system. One Intel Bay Trail cpu, 4 cores.
Code:

hazel@bigboy:~
$ nproc
4


dmchess 07-20-2019 12:08 PM

Another simple way to tell, start top and then press "1".

top - 12:07:30 up 10 days, 17:08, 1 user, load average: 0.26, 0.10, 0.07
Tasks: 277 total, 1 running, 275 sleeping, 0 stopped, 1 zombie
%Cpu0 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu1 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu4 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu5 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 17.0 us, 2.3 sy, 0.0 ni, 80.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu8 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu9 : 0.3 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu10 : 1.3 us, 0.0 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu11 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 16379904 total, 11147844 free, 1504144 used, 3727916 buff/cache
KiB Swap: 16653308 total, 16653308 free, 0 used. 14348768 avail Mem


All times are GMT -5. The time now is 06:20 AM.