Ran the top command to check CPU performances and memory usage on the New RPi3 while running a browser.

Since we have a 4× ARM Cortex-A53, 1.2GHz, how should I read the result?

$ top

Mem: 327132K used, 620864K free, 29124K shrd, 5800K buff, 164492K cached
CPU:  80% usr   8% sys   0% nic   2% idle   0% io   0% irq   9% sirq
  • 80% un-niced processes
  • 8% system processes
  • 2% idle?

    My understanding is that when it shows 80%, that means 80% out of 400% full capacity, since we have 4 cores right?

    Does that mean that the top command doesn't not calculate the idle correctly?

    How do I check the % usage/idle for each core?

My Linux (Image built with Yocto for RPi3)

root@raspberrypi3:~# uname -a
Linux raspberrypi3 4.1.18 #1 SMP Thu Mar 17 10:26:07 CET 2016 armv7l GNU/Linux

root@raspberrypi3:~# lsb_release -a
LSB Version:    core-4.1-noarch:core-4.1-arm
Distributor ID: poky
Description:    Poky (Yocto Project Reference Distro) 1.8.1
Release:    1.8.1
Codename:   fido

top version

root@raspberrypi3:~# top --version
top: unrecognized option '--version'
BusyBox v1.23.1 (2015-10-19 16:33:36 CEST) multi-call binary.

Usage: top [-b] [-nCOUNT] [-dSECONDS]
  • You can also get the per-cpu info from mpstat -P ALL (from package sysstat). – meuh Mar 22 '16 at 8:57

Depending on the version of top, the CPU usage summary might use 100% to mean one core's worth or to mean the total available CPU. Given your output, it appears that you're using the BusyBox version of top; it uses 100% to mean the total available CPU time, so your CPU is fully busy, spending about 80% of its time on computations and about 19% on I/O. The entry for each process also gives stats relative to the whole available processing power, so on a quadcore machine each thread tops out at 25%.

The top version from procps (the version on non-embedded Linux, also the default version on e.g. Raspbian) uses different conventions: for the global CPU consumption, 100% is the total across CPU; but for each process, 100% means one CPU's worth.

htop has a nicer interface and breaks down CPU usage per CPU. There you'd see each CPU's utilization. On individual processes, htop counts one CPU's worth as 100%, like the procps version.

Keep in mind that calculations are not exact, they're based on sampling. (Taking precise CPU utilization measurements would itself take up significant CPU time, especially in cases of high contention.) There isn't a meaningful difference between 2% idle and fully busy.

  • If you type 1 while top is running on the pi it should change the summary area to show per-cpu info. – meuh Mar 22 '16 at 8:55
  • @meuh Ah, I didn't know that, thanks, but that's only with procps top, not with Busybox top which is the one shown in the question. – Gilles 'SO- stop being evil' Mar 22 '16 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.