Celedhrim / docker-kodi-server

Runs Kodi in headless mode with docker
MIT License
79 stars 20 forks source link

High CPU and Ram on Synology NAS #23

Closed Shasoosh closed 2 years ago

Shasoosh commented 4 years ago

Hey

I've just run the container and without it doing anything special, I'm seeing constant 11%-15% CPU and 1.2GB of RAM usage.

Is that normal behavior ?

image

Celedhrim commented 4 years ago

Mine take 500mb memory and ~3% cpu when idle so i don't know :/

Shasoosh commented 4 years ago

Any idea what might affect it? I'm using a DS920+ Synology NAS with +-200 Movies.

btw, what is the CPU used for when idle?

Celedhrim commented 3 years ago

Look at the README , i've just update it.

You could try disable all menu to not display anything dynamically ( like last movies , random movies etc , also , hide library update) Anything that move on the GUI cause fake display using CPU

DAVIZINH0 commented 3 years ago

hello, this is the one container with kodi matrix, so CONGRATULATION! AND thanks!!!!

I mount it in a synology and have a heavy cpu usage 15 iddle. 50 max (synology 1819+), ram is razonable (500mb aprox). But i have a lot of reboots of the container and i dont know why.

maybe it will be interesting make a list of "guisettings.xml" with a recomend settings to maximice de performance.

Celedhrim commented 3 years ago

Thx :) xpra is not very good for performance , but at least it's works without doing crazing things to kodi :)

Mine is up for 4 days , use 2% cpu on idle ( eat on start and database clean because display do something) and ~600 MB of memory.

did you have log while is failed ? oom ? segfault ?

DAVIZINH0 commented 3 years ago

totally agree this is best than nothing!!! thanks a lot!!! really thanks!!!

this is my log X.log

and this is a capture of the reboots

reboots
Celedhrim commented 3 years ago

Does your image is the ubuntu 18.04 or my fail test on 20.04 ?

DAVIZINH0 commented 3 years ago

Does your image is the ubuntu 18.04 or my fail test on 20.04 ?

latest tag, download this morning. how can i see to give you the exact information?

edit: its not a problem to delete de container a create it again, no problem if helps you

Celedhrim commented 3 years ago

For pulseaudio I have this :

2021-02-20 20:54:13,397 pulseaudio server started with pid 98
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/root/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/root/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/root/.pulse-cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/root/.pulse-cookie': No such file or directory
W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message
W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message

at startup and nothing more

Not like you.

to get os version in container :

celed@server:~$ docker ps | grep kodi
f230caa994f1   celedhrim/kodi-server:matrix               "/bin/kodi-run-wrapp…"   4 days ago     Up 4 days             8089/tcp, 9090/tcp, 9777/udp   kodi_kodi.1.1pafvd9koyto9wu46s2g1dpoe
celed@server:~$ docker exec -ti f230caa994f1 /bin/bash
root@f230caa994f1:/# cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

root@f230caa994f1:/# exit
DAVIZINH0 commented 3 years ago

same as you `root@kodi-matrix:/# cat /etc/issue

Ubuntu 18.04.5 LTS \n \l

root@kodi-matrix:/# `

but not problem, works!! and its the most important for me! thanks!!

Celedhrim commented 3 years ago

Maybe something with synology docker implemntation , I don't know :(

DAVIZINH0 commented 3 years ago

maybe, dont worry! i try the next days and monitor the reboots. thanks for your work! Now the cpu usage is stable in 10%. is acceptable for me

Shasoosh commented 3 years ago

I ended up moving to another built: https://github.com/schwensk/kodi-headless With it I'm getting less than 1% of CPU and a very low mem usage.

                     CPU                  RAM
kodi-headless       0.96%               29.51MiB / 19.39GiB   
Celedhrim commented 3 years ago

I ended up moving to another built: https://github.com/schwensk/kodi-headless With it I'm getting less than 1% of CPU and a very low mem usage.

                     CPU                  RAM
kodi-headless       0.96%               29.51MiB / 19.39GiB   

Yep , but it's another "headless" patch build. So only Leia until someone make a matrix headless patch :)

For me it's not future proof . My way to do this is really not ideal, I know that , but I can use stock kodi from team kodi ppa .

DAVIZINH0 commented 3 years ago

I ended up moving to another built: https://github.com/schwensk/kodi-headless With it I'm getting less than 1% of CPU and a very low mem usage.

                     CPU                  RAM
kodi-headless       0.96%               29.51MiB / 19.39GiB   

but this is not matrix, or im wrong?

DAVIZINH0 commented 3 years ago

hi again, i see that a import creates all the thumbnails in the docker container. Maybe disable this option, reduce the cpu usage when scan?

maybe its a stupid idea

alek-05 commented 3 years ago

Hello, I'm more or less in the same situation as Shasoosh: Synology DS1515+, around 400 movies and 80 TV series. The container use 12/13% cpu all time and only 300M ram. As you suggested I disabled all menu and set Settings as default. Not sure if I should do something else. Thank you. image

desmoloch commented 3 years ago

thanks for your work. I updated to matrix on my synology ds918+ and all is working fine! My cpu usage is about 4 % and using ~350 MB ram. First i had about ~40 % CPU Usage, here is what i did:

alek-05 commented 3 years ago

I'm not able to save these settings from the webgui! I change it but when I save it doesn't do anything. And refreshing the page I see the default settings. Any suggestion on how to save it? Maybe from the xml files? Thank you.

desmoloch commented 3 years ago

i changed it on my local (windows) kodi and transferred the configs. Here is my config from guisettings.xml: <setting id="videoscreen.screenmode">0064000480056.00000pstd</setting> Edit it and it should work :)

alek-05 commented 3 years ago

wow, it worked! :D many thanks! CPU is now around 5%, without disabling the event logging!