Posts

How to Check CPU Detailed Information

There are several ways in order to check the CPU detailed Information.

1) /proc/cpuinfo

The /proc/cpuinfo and sysfs stores info about your CPU architecture ike number of CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches, CPU family, model, bogoMIPS, yte order and much more:

# less /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz
stepping        : 4
cpu MHz         : 2400.084
cache size      : 30720 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht nx constant_tsc aperfmperf pni pclmulqdq ssse3 sse4_1 sse4_2 x2apic popcnt aes f16c rdrand hypervisor ida arat
bogomips        : 4800.16
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

2) nproc

The nproc command just prints out the number of processing units available. Note that the number of processing units might not always be the same as number of cores.

# nproc
2

3) getconf

The most simplest tool comes with glibc and is called getconf:

# getconf _NPROCESSORS_ONLN
2

4) lscpu

lscpu is a small and quick command that does not need any options. It would simply print the cpu hardware details in a user-friendly format.

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
Stepping:              4
CPU MHz:               2494.094
BogoMIPS:              4988.18
Hypervisor vendor:     Xen
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              25600K
NUMA node0 CPU(s):     0

5) dmidecode

The dmidecode command displays some information about the cpu, which includes the socket type, vendor name and various flags.

# dmidecode -t 4 | grep CPU
        Socket Designation: CPU1
        Version: Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
        Socket Designation: CPU2
        Version: Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz