Linux CPU Utilization Overview

I use a single-core small ARM processor running under Debian, and I have problems understanding the result of loading the processor from above, see

top - 15:31:54 up 30 days, 23:00, 2 users, load average: 0.90, 0.89, 0.87 Tasks: 44 total, 1 running, 43 sleeping, 0 stopped, 0 zombie Cpu(s): 65.0%us, 20.3%sy, 0.0%ni, 14.5%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st Mem: 61540k total, 40056k used, 21484k free, 0k buffers Swap: 0k total, 0k used, 0k free, 22260k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 26028 root 20 0 2536 1124 912 R 1.9 1.8 0:00.30 top 31231 root 19 -1 45260 964 556 S 1.9 1.6 1206:15 owserver 3 root 15 -5 0 0 0 S 0.3 0.0 0:08.68 ksoftirqd/0 694 root 20 0 28640 840 412 S 0.3 1.4 468:26.74 rsyslogd 

The% CPU column is very low for all processes, in this example, all together 4.4% (all other processes were lower by 0%) But the all-processor processor on line 3 shows 65% of us and 20% sy, therefore for a very high value - and by the way, the system feels this way: very slowly :-( The system is almost always in this state: a very low processor for all processes, but a high user system CPU. Can anyone explain why there is such a high inconsistency in the top release of the tool ? And what tool can I use, to get to know better what leads to higher-level use of the system processor - the top seems to be useless here.

update : in the meantime, I found this thread here , which discusses a similar question, but I can’t check what is written there:

  • Command timeout shows average CPU usage by 1/5/15 minutes
  • This is close to the fact that the first line of the top exits is the sum of% us +% sy. But it changes a lot more, maybe this is the average of 10 seconds?
  • Even if you watched a longer time on the top output, the sum of% us +% sy is always several times higher than the summary of all% CPU

Thanks Achim

+8
performance linux
source share
1 answer

You should read the manpage of top to better understand its output. From manpage:

% CPU - CPU usage

The percentage of the processor’s elapsed time task since the last screen update, expressed as a percentage of the total processor time. The default screen refresh time is 3 seconds, which can be changed using #top -d ss.tt To measure switched CPU usage, run top -S .

-S: cumulative time mode switch

Starts the top with the last memorized state “S”. When Cumulative Mode is turned on, each process is displayed with the processor time that it and its dead children used.

The status of the CPU is displayed in the summary area. They are always displayed as a percentage and are between the time and the last update.

  us -- User CPU time The time the CPU has spent running users' processes that are not niced. sy -- System CPU time The time the CPU has spent running the kernel and its processes. ni -- Nice CPU time The time the CPU has spent running users' proccess that have been niced. wa -- iowait Amount of time the CPU has been waiting for I/O to complete. hi -- Hardware IRQ The amount of time the CPU has been servicing hardware interrupts. si -- Software Interrupts The amount of time the CPU has been servicing software interrupts. st -- Steal Time The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine). 

Under normal conditions,% us +% sy should always be higher.

+6
source share

All Articles