CPU usage and system load while idle

I’m very happy with my Vero 4K, so far it’s been phenomenal.

The only thing I’ve noticed is that even when it is stopped (not paused but stopped, on the main screen), kodi.bin uses about 30% cpu and the system load stays at around 2.30.

It is also warm to the touch.

Should I be worried? How can I fix it?

Don’t worry about system load…it’s not really an indicator of anything by itself.

As for kodi.bin using that much CPU when essentially idle, it often has to do with either the skin you use or add-ons you have installed. My Vero 4K idles at about 5% CPU when using the Titan skin, which has a few background processes (random pictures, etc.), but I don’t have any add-ons beyond the basics.

Well, the skin is the default of OSMC, I haven’t changed anything there.

As for the system load, it actually is an indicator of how many processes need cpu time on average (2.3 meaning that 2.3 processes were on the run queue on average). And a process inside the run queue is a process which is anything but idle.

Furthermore, if I pause any movie and click on the info, from the 4 cpus, the first is always at about 30% usage (used by kodi.bin). Which means that kodi is actually doing something…!

This doesn’t seem “normal” behavior…

I just checked and my usage and load seems similar to yours, but mine isn’t warm at all and I don’t experience any issues with it so not sure why yours go warm. I’m using a fairly default setup with estuary or whatever the skin is called.

This is not true, as processes in “uninterruptible sleep” count towards the load average, but they are waiting on things like disk I/O. Again, by itself load average means almost nothing. You also have to take into account the average over time (is it going up/ going down/steady?), and how many CPUs you have. The rule of thumb is that having long term load average lower than your CPU count means your system is basically “idle”.

If you want to see more, first use “U” in top to filter by only the osmc user. Then use the
“V” and “H” keys to give you a tree view and you will see which threads are taking actual CPU. Here’s what mine looks like:

top - 12:15:54 up 15 days, 16:15,  1 user,  load average: 1.42, 1.39, 1.34
Threads: 170 total,   2 running, 168 sleeping,   0 stopped,   0 zombie
%Cpu(s):  3.6 us,  1.3 sy,  2.6 ni, 92.3 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem :  1832388 total,   377388 free,   467024 used,   987976 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  1277844 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
  408 osmc      20   0    7732   2020   1512 S  0.0  0.1   0:00.12  `- udisks-glue
27958 osmc      20   0  918688 355784  36920 S 15.9 19.4   2592:12          `- kodi.bin
27959 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:00.75              `- Announce
27960 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:00.00              `- FDEventMonitor
28007 osmc      20   0  918688 355784  36920 S  0.0 19.4   4:39.50              `- ActiveAE
28008 osmc      20   0  918688 355784  36920 S  0.0 19.4   2:52.08              `- AESink
28010 osmc      20   0  918688 355784  36920 S  0.6 19.4 105:54.77              `- kodi.bin
28011 osmc      20   0  918688 355784  36920 S  0.6 19.4  98:32.50              `- kodi.bin
28012 osmc      20   0  918688 355784  36920 S  0.0 19.4   1:42.91              `- kodi.bin
28013 osmc      21   1  918688 355784  36920 S  0.0 19.4   9:04.53              `- PeripBusUSBUdev
28014 osmc      21   1  918688 355784  36920 S  3.9 19.4 596:24.93              `- PeripBusCEC
28015 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:37.87              `- PeripBusAddon
28016 osmc      20   0  918688 355784  36920 S  0.3 19.4  61:51.77              `- kodi.bin
28018 osmc      21   1  918688 355784  36920 S  0.3 19.4  14:04.72              `- LanguageInvoker
28019 osmc      21   1  918688 355784  36920 S  0.0 19.4  10:04.41              `- LanguageInvoker
28020 osmc      21   1  918688 355784  36920 S  0.3 19.4  32:16.59              `- LanguageInvoker
28021 osmc      21   1  918688 355784  36920 S  0.0 19.4  10:11.74              `- LanguageInvoker
28022 osmc      21   1  918688 355784  36920 S  0.0 19.4   7:29.89              `- LanguageInvoker
28023 osmc      21   1  918688 355784  36920 S  0.0 19.4   7:56.63              `- LanguageInvoker
28052 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:00.00              `- MHD-listen
28053 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:00.00              `- MHD-listen
28054 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:00.00              `- kodi.bin
28055 osmc      20   0  918688 355784  36920 S  0.0 19.4   5:50.44              `- kodi.bin
28056 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:17.52              `- kodi.bin
28057 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:26.94              `- kodi.bin
28058 osmc      20   0  918688 355784  36920 S  0.0 19.4   4:33.89              `- kodi.bin
28059 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:55.83              `- EventServer
28060 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:50.84              `- TCPServer
28067 osmc      20   0  918688 355784  36920 S  0.0 19.4   0:11.73              `- kodi.bin
28074 osmc      21   1  918688 355784  36920 R  0.0 19.4  19:42.54              `- kodi.bin
28107 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:52.92              `- LanguageInvoker
28111 osmc      21   1  918688 355784  36920 S  0.3 19.4  66:43.63              `- LanguageInvoker
28112 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:00.00              `- LanguageInvoker
28137 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:53.73              `- LanguageInvoker
32447 osmc      20   0  918688 355784  36920 S  0.0 19.4   6:40.57              `- AlarmClock
 2943 osmc      21   1  918688 355784  36920 S  0.3 19.4  32:35.31              `- LanguageInvoker
 2947 osmc      21   1  918688 355784  36920 S  0.0 19.4  32:25.61              `- LanguageInvoker
 2966 osmc      21   1  918688 355784  36920 S  0.0 19.4  32:24.82              `- LanguageInvoker
16845 osmc      21   1  918688 355784  36920 S  0.0 19.4  29:44.52              `- LanguageInvoker
22538 osmc      21   1  918688 355784  36920 S  3.6 19.4  43:01.52              `- LanguageInvoker
31410 osmc      21   1  918688 355784  36920 S  0.0 19.4   0:00.00              `- Timer

Note that according to the kernel, all threads in kodi.bin are “sleeping”…none are in a runnable state. You can’t see the runnable threads, as they are not owned by osmc, but rather by root (i.e., the kernel, or the “top” process).

As @nabsltd said, this is not true. On a quad code system, a load average of 4.0 is the same as a load average of 1.0 on a single core system. So your load average of 2.3 is roughly the same as .57 on a single core system.

Read this for more information about load average: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages

Kodi v18 has a lot of improvements that bring the idle load right down.

I wouldn’t worry about anything at this time if the device is responsive and behaving as expected. Warm to the touch is fine; the top of the device serves as a heatsink.

Sam

Exactly. And would you say that a single core system with a load of 0.57 is “idle”? It is not, something is using up the cpu (but not at 100% - there is room for more utilization). Something is being done. That is the point of my post, kodi, when stopped, should be at 0%. But it is not. It is at about 30%. Why?

Well the device has 4 cores, of course it will be responsive if only one is being used at about 30%. The issue is why? Is it maybe a bug?

Well, mine switches between runnable and sleeping! But since it is mostly sleeping and we get one update every second or so, you get the characterization of “S”, since it is more probable to hit it as sleeping when refreshing the stats. I have actually seen it as “R” many times. For example:

Tasks: 140 total,   2 running, 137 sleeping,   0 stopped,   1 zombie
%Cpu(s):  6.2 us,  1.1 sy,  1.1 ni, 91.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1832388 total,    78156 free,   391920 used,  1362312 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  1249944 avail Mem

PID   USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
8319  osmc      20   0  699024 197112  14500 R  31.4 10.8   2122:21 kodi.bin
3222  debian-+  20   0  187328 102132   3580 S   0.8  5.6 189:37.63 transmission-da
11771 osmc      20   0    5536   1560    984 R   0.8  0.1   0:00.06 top
84    root      20   0       0      0      0 S   0.4  0.0   9:40.42 kthread_di
11403 root      20   0       0      0      0 S   0.4  0.0   0:09.46 kworker/1:0
1     root      20   0   26504   2808   1572 S   0.0  0.2  11:37.22 systemd
...

Should be fixed in Kodi v18 or at least significantly reduced

Yes, Kodi is running, and it’s GUI is well know as a CPU hog. I get the same running it on Linux Mint. The point is that a LA of 2.3 is not that bad. Read the article I linked. They say anything below .7 is not worth worrying about.

I think I’ve found the culprit!

It seems that the screensaver and specifically “dim” is to blame. I’ve disabled it and, lo-and-behold, kodi dropped from 30-40% to 7%-20% cpu usage. I’ll continue to monitor the system and report back.

Never, what you see is most possible the effect that while you saw “30-40%” you were in another menu like the main menu whereas “7-20%” you see in another like being in settings -> interface -> screensaver or so.

If you get your CPU utilization numbers with top the sample intervals are too short and therefore the values are too “spiky”.

Try to get longer update intervals in top like

top -d 15.0

which gives you averages over the longer time windows and allows you to better compare effects of changes.

Even with -d 15, kodi.bin now stays at about 11%, in contrast with about 35% without the screensaver. I will check again when I return home and report back…

On the other hand, load has dropped slightly to about 2.1…