Environment No specific environment as this would be command.
(Aruba7240) #show cpuload
user 29.5%, system 61.6%, idle 8.9% ===================This may not the right command and this idle percentage will be calculating different values.
Show cpuload current gives out the exact CPU usage for individual process.
See below for more explanation
- Show cpuload
- This CLI uses a direct kernel interface to return a pre-calculated average of CPU usage across all the control plane CPUs. Kernel on every timer interrupt keeps such statistics which this CLI uses and displays.
- It can be used to get a knowledge of system usage as a whole. In this we don’t try to demarcate what processes in what space (user or kernel) are taking up the CPU.
- It just tells how much, system as a whole, is busy and where.
- Show cpuload current
- This CLI uses top2 command internal to display the stats.
- top2 command works on sampling per CPU usage. Thus is need 1 or 2 consecution runs to come to an exact system load.
- The CLI runs the command in single-shot mode and displays the output. As a result of which, the 3rd line doesn’t give correct system usage. If you run top2 command from the shell prompt, without any options, you will see that first display shows incorrect usage in 3rd line. But in further displays it will converge and come to correct value.
- This CLI should be used to check the exact per-process CPU utilisation. This also is instantaneous but it decouples per-CPU process scheduling and usage. Hence tells exact CPU usage each process is having in SMP systems.
- Show processes sort-by cpu
- This CLI uses the ps command to show the output.
- The CPU utilisation here should be at par with “show cpuload current”. But this command also works on instantaneous samplings. In case of momentary peak or a delay between runs of “show cpuload current” and this CLI, there might be a difference in the output.
From highlighted output we could notice CPU utilization is 97.2% idle with 1.2% for users and 1.4% for system which is good.
Show cpuload current
op2 - 13:50:37 up 47 days, 15:40, 0 users, load average: 21.05, 19.49, 14.00
Tasks: 191 total, 22 running, 169 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.2%us, 1.4%sy, 0.0%ni, 97.2%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 5715712k total, 2862592k used, 2853120k free, 140224k buffers
Swap: 0k total, 0k used, 0k free, 596608k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28686 nobody 20 0 231m 25m 7168 S 121 0.5 0:02.91 httpd
3394 root 20 0 130m 16m 4032 S 18 0.3 615:07.31 mysqld
3552 root 20 0 387m 201m 30m S 12 3.6 1510:10 stm
3966 nobody 20 0 47936 8832 4096 S 11 0.2 3:40.01 httpd
29003 nobody 20 0 8000 4736 3072 R 11 0.1 0:00.06 login
29006 nobody 20 0 7808 2624 1344 R 9 0.0 0:00.05 login
29009 nobody 20 0 64 64 0 R 9 0.0 0:00.05 httpd
29011 nobody 20 0 45760 5824 1088 R 9 0.1 0:00.05 httpd
29015 nobody 20 0 42688 5824 1088 R 9 0.1 0:00.05 httpd
4 root 20 0 0 0 0 S 7 0.0 210:59.90 ksoftirqd/0
28967 nobody 20 0 7808 2624 1344 R 7 0.0 0:00.05 login
29007 nobody 20 0 7808 2624 1344 R 7 0.0 0:00.04 login
29008 nobody 20 0 43328 5824 1088 R 7 0.1 0:00.04 httpd
29010 nobody 20 0 41152 5824 1088 R 7 0.1 0:00.04 httpd
29013 nobody 20 0 39488 5824 1088 R 7 0.1 0:00.04 httpd
29014 nobody 20 0 42688 5824 1088 R 7 0.1 0:00.04 httpd
29016 nobody 20 0 39808 5888 1088 R 7 0.1 0:00.04 httpd
29017 nobody 20 0 47936 5824 1088 R 7 0.1 0:00.04 httpd
29019 nobody 20 0 46784 5824 1088 R 7 0.1 0:00.04 httpd