UNIX CPU Diagnostics
CPU Usage
top
Once in top.. hit 'z' to colourize, '1' to show individual cpu cores, '?' for other optionshtop
htop
Processes using most CPU
dstat -c --top-cpu
CPU Load
Load average generally display three figures representing the average load over the last 1 minute, 5 minutes, and 15 minutes. The load average is displayed by various tools (w,top, htop), but this is probably the simplest...
uptime
On Linux, system load includes threads in Runnable (R) and in Uninterruptible sleep (D) states (typically disk I/O). On other flavours of UNIX this is usually just R (not D).Load should be less than the number of cores in your system. i.e. On a single core machine you would want load to be less than 1. On a quad core machine you would want load to be less than 4.
We can see which users are contributing to system load using...
ps -eo s,user | grep ^[RD] | sort | uniq -c | sort -nbr | head -20
On Linux, system load includes threads in Runnable (R) and in Uninterruptible sleep (D) states (typically disk I/O). On other flavours of UNIX this is usually just R (not D).To see what they are running use...
ps -eo s,user,cmd | grep ^[RD] | sort | uniq -c | sort -nbr | head -20
On Linux, system load includes threads in Runnable (R) and in Uninterruptible sleep (D) states (typically disk I/O). On other flavours of UNIX this is usually just R (not D).CPU Benchmarking
Sysbench
sysbench --test=cpu run
CPU Blowfish
Screenshot is from hardinfo. This tends to be available in Ubuntu as "System Profiler and Benchmark"
Geekbench
TODO
CPU Information
CPU Count
nproc --all
getconf _NPROCESSORS_ONLN
CPU Information
lscpu
cat /proc/cpuinfo
sudo dmidecode -t 4
Handle 0x0004, DMI type 4, 42 bytesProcessor Information Socket Designation: CPU0 Type: Central Processor Family: Xeon Manufacturer: Intel ID: D7 06 02 00 FF FB EB BF Signature: Type 0, Family 6, Model 45, Stepping 7 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Xeon(R) CPU E5-2667 @ 2.90GHz Voltage: 1.1 V External Clock: 100 MHz Max Speed: 3800 MHz Current Speed: 2900 MHz Status: Populated, Enabled Upgrade: Socket LGA2011 L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006 L3 Cache Handle: 0x0007 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Core Count: 6 Core Enabled: 6 Thread Count: 12 Characteristics: 64-bit capable Multi-Core Hardware Thread Execute Protection Enhanced Virtualization Power/Performance Control
Handle 0x0008, DMI type 4, 42 bytesProcessor Information Socket Designation: CPU1 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 00 00 00 00 00 00 00 00 Signature: Type 0, Family 0, Model 0, Stepping 0 Flags: None Version: Intel(R) Xeon(R) CPU E5-2667 @ 2.90GHz Voltage: 0.2 V External Clock: 100 MHz Max Speed: 4000 MHz Current Speed: Unknown Status: Unpopulated Upgrade: Socket LGA2011 L1 Cache Handle: Not Provided L2 Cache Handle: Not Provided L3 Cache Handle: Not Provided Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Core Count: 101 Core Enabled: 85 Thread Count: 63 Characteristics: Multi-Core Enhanced Virtualization Power/Performance Control
sudo lshw -class processor
sudo dmidecode -t 4 | egrep -i 'core (count|enabled)|thread count|Version'
hwinfo --cpu --short
hwinfo --cpu
inxi -Cx -c 5
cpuid -1
The -1 flag stops cpuid returning duplicate information (if you know all CPUs are the same)fpuvmedepsetscmsrpaemcecx8apicsepmttrpgemcacmovpatpse36
clflushdtsacpimmxfxsrssesse2sshttm
pbe
pnipclmulqdqdtes64monitords_cplvmxsmxesttm2ssse3
cx16xtprpdcmpciddcasse4_1sse4_2x2apic
popcnttsc_deadline_timeraesxsave
avx
dthermidaaratplnpts
md_clear
flush_lid
Architecture (32-bit or 64-bit)
arch
uname -m
getconf LONG_BIT
lscpu | grep Architecture
hwinfo --cpu | grep Arch | uniq
inxi -Cx | grep bits
Flags/Capabilities
Bibliography
Benchmarkinghttps://www.addictivetips.com/ubuntu-linux-tips/linux-cpu-benchmark-tool/
Flagshttps://unix.stackexchange.com/questions/43539/what-do-the-flags-in-proc-cpuinfo-mean