High cpu usage after August 2017 update

I’ve been using osmc in my raspberry pi 3.
From the last updates I’ve noticed an increasing cpu usage (measured with top) by kodi.
In the july update, with the system idle (hdd was even in standby) it was using around +20% of cpu.

After the last august update, kodi keeps using +40% cpu time.

any thoughts about this ?

My last log:
https://paste.osmc.tv/komabosihe

thanks

They’re not full logs – so it’s hard to say.

  • You seem to be running Transmission which will use CPU quite extensively
  • It looks like you have your SSH open to the world

Disable unnecessary services and I suspect you will see a decrease in system load.

1 Like

I thought the same upon updating but after a few mins mine settles down.

After a quick observation on both a 4K and Pi2, the idle load pretty much doubled. Both systems have been rebooted twice after the update and are up for 60 minutes. So the Kodi process should be back to normal.

To me an indicator that this is something to investigate.

Agreed – some logs would be great.

Have you seen any actual changes in performance, or are you just looking at the system load?

Do you have the numbers before / after?
OP seems to be talking about Kodi’s load. You seem to be talking about overall system load.

I just ran the updates but didn’t have a chance to actually notice any changes to the responsiveness. Needs more time in front of the screen.

Since no other processes are using any resources to speak of, Kodi pretty much is the system load. Not that this would be of any actual help but from memory here are the old top numbers compared to the new (factual) ones:

Pi2: 20-30% -> 58%
4K: 25% -> 40%

To be honest CPU usage always fluctuate and updates can bring a change. But looking at the last 7 days of my Vero CPU I can not say that there is such a significant change from before and after. Will check my Pi3 after I have done the update.

1 Like

@sam_nazarko

Thank you for your reply

Allow me to comment:

  • Logs:
    For the logs I’ve done a simple:
    sudo journalctl | paste-log
    Do you suggest another approach for more detailed logs ?

  • CPU usage:
    Yes, Transmission is installed but usually idle.
    My major concern is not Overall CPU usage but the specific Kodi component.
    Just kodi is using around 40% of cpu time, with july update it was around 20%.
    The system is now up for 11 hours, kodi using around 45% CPU
    Please look at the following snip from top:

    top - 11:20:09 up 18:10, 1 user, load average: 0.76, 0.57, 0.50
    Tasks: 159 total, 2 running, 157 sleeping, 0 stopped, 0 zombie
    %Cpu(s): 11.2 us, 0.2 sy, 0.2 ni, 88.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
    KiB Mem: 749584 total, 622920 used, 126664 free, 172028 buffers
    KiB Swap: 0 total, 0 used, 0 free. 299720 cached Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    447 osmc 20 0 611896 124644 44864 R 45.1 16.6 467:51.13 kodi.bin
    19387 osmc 20 0 3072 1776 1400 R 1.0 0.2 0:00.11 top
    15554 root 20 0 0 0 0 S 0.3 0.0 0:00.10 kworker/2:0
    1 root 20 0 22084 3376 2144 S 0.0 0.5 0:33.00 systemd

  • SSH:
    Yes. Ssh is temporary open to the world.
    Ssh is running in a non-standard port.
    The PI is connected to a router which usually have that port closed.
    I’ve opened the port in the router in order to do the post update tests.
    The router is running with a dynamic WAN IP which usually change sin a daily basis.
    Usually, I try to connect to ssh using a vpn connection (openswan, installed also in the pi).

Thank you very much

Do a quick test, put Kodi on a different menu. Eg go to settings. Leave it there for a few minutes and then check CPU again.

KODI was on the main menu.
placed it on settings menu.
and … KODI cpu usage decreased from 45% to … 4% !!!
:open_mouth:

awesome !
good call :slight_smile:

Now, just a question: Why is that KODI on the main menu is continually using 45% cpu ? (when it was 20% with previous kodi version ? anyone knows what changed in kodi to make this ?)

That is what we have to find out next (eg with debug logging) but for the moment suggest one more test go to main screen and put it on a menu without modules (eg the Power menu) and check CPU load

It seems to be something at the image rendering level:
Everytime KODI is in a menu which has movie snippets (images) CPU usage raises to 45%.
If in a menu without images, it lowers to 4%-5%

1 Like

Yeah seems like that while I am not sure if it is the rendering or actually the database request causing it.
Can you enable debugging and check the logs?
I will only be later able to do so.

(I will try: At the moment I’m at the office connected trough vpn and vnc to remotely control osmc at home - it is very slow to use the graphic interface - if i’m not able to do it now, I will surely do it once I get home)

1 Like

Which skin are you using?

Try switching to a different one

@sam_nazarko @fzinken

I’m using the default osmc skin.

The system is running 1080x1920@23.98 fps display.

More than 40% cpu consuming by kodi in stand-by when in main menu.
Entering in any sub-menu lowers the cpu usage for less than 10%. Any sub-menu ! Even in movies and tv-shows sub-menus with the image snippets loaded (so, I assume it is not related with images rendering).

Changing the skin for Estuary lowers the cpu usage form 40% to 30%, but gives higher cpu usage in sub-menus from less than 10% to middle 20%.

I have enabled debug mode for some minutes with osmc skin, several times alternating from main menu to sub-menus and waiting for a stable cpu usage.
kodi.log is here for that time:
https://paste.osmc.tv/aluviyukog.coffee

The only thing that calls my attention in the logI see as different is the loading of the python script when opening the main menu window:
/home/osmc/.kodi/addons/script.skinshortcuts/default.py

I doubt it is realted to the skinshortcuts as I don’t have installed them. But I also don’t see anything in the logs.

Not much to add except to corroborate the increased CPU usage of kodi process, from averaging 20-30 % to 40-50. Not using OSMC skin, before or after. I do run a bunch other stuff, like transmission but so did before also. There was an sqlite update so might have something to do with that, may be not.

I do see kodi process changing states a lot: R <-> S
I am not sure if that was there before.

I’ve also made a new test by moving out ~/.kodi directory and so forcing a fresh kodi startup.
After some minutes for obvious initialization I get the same 45% CPU usage when in main menu and only main menu.
Also tried disabling the recent entries widget for movies and tv shows. No difference whatsoever.

[edit]
In another test I now have the video menu displayed for 39 minutes with and average of only 5% CPU usage.