Linux 45% CPU when idle
#1
Hi all,

I've recently gone to a combined XBMC and server machine using Ubuntu 12.04 with XBMC as a desktop replacement and running all my server tasks in the background (sickbeard, uTorrent, sabnzbd, headphones, couchpotato, plex, perforce etc.). The idea being that the server has to be on all the time anyway and it's nice to have xbmc ready to go without booting a second machine. I'm running it on an old laptop with some external hard drives for my enormous TV & music collection. The machine is a Core2 duo 2.2ghz with 4gb ram.

Anyway, while XBMC is idle it still seems to take 45% of the CPU for doing nothing but sitting on the home screen. I've been monitoring it from work for a few hours now and it is quite steady with the odd spike when I guess it updates something on a timeout (library maybe?). Edit: I've just noticed that this is 45% of 200% max as htop calculates a percentage per core.

So, my question is, is this normal? I know the home screen needs rendering etc, but 45% of the CPU on this spec machine seems very excessive. I can't see what else it's doing. If It is the render code would setting the screensaver to turn the monitor off stop the render code?

If this is normal, is there a way to get XBMC to quit on idle rather than sleep? That way I could have a script that could launch it again from a remote control button press.

I expected my server to tick over with little to no CPU time when idle, and in fact if you subtract XBMC from the CPU time it is ticking over at just a few percent. I'd rather not have the machine run at 45% CPU when doing nothing as this is an extra electricity cost, even if very small so would love to find a solution to this. I know it's not really a big deal, but it bugs me. Plus the fan on the laptop is almost permanently on high when idle which annoys my girlfriend Big Grin

Any help would be much appreciated.

Thanks,
Max


Image
Reply
#2
debug log could help,

it could be some addon in xbmc that is causing hiigh cpu.

try to stop and start xbmc and see what happens.

Reply
#3
There's nothing obvious in the log file.

There seems to be jobs every 20 mins or so since the last reboot 12 hours ago. Nothing untoward in my limited knowledge.

Hmmm.

09:35:50 T:2943343424 NOTICE: -->Python Interpreter Initialized<--
09:36:35 T:2807077696 NOTICE: Thread Jobworker start, auto delete: true
09:56:00 T:2997963584 NOTICE: Previous line repeats 6 times.
09:56:00 T:2997963584 NOTICE: Thread CRssReader start, auto delete: false
09:58:26 T:2901408576 NOTICE: Thread Jobworker start, auto delete: true
10:05:49 T:2951736128 NOTICE: Previous line repeats 3 times.
10:05:49 T:2951736128 NOTICE: Thread XBPyThread start, auto delete: false
10:05:49 T:2951736128 NOTICE: -->Python Interpreter Initialized<--
10:05:52 T:2951736128 NOTICE: Thread XBPyThread start, auto delete: false
10:05:52 T:2951736128 NOTICE: -->Python Interpreter Initialized<--
10:07:48 T:2943343424 NOTICE: Thread Jobworker start, auto delete: true
Reply
#4
After a bit of googling it seems that many people see this kind of CPU usage when idling. I was hoping it was something that could be fixed. I will try to turn off the screen to see if this makes any difference.

The only other plan is to get XBMC to quit on idle of 30 mins (I think this is an option, right?) and write a script for lirc to start it back up again on a button press.

Unless anyone can tell me their system idles with minimal CPU?
Reply
#5
My Eden install does this if someone starts another instance of XBMC when it's already running. The second copy seems to run right around 45% too, on a quad core CPU. The first instance reports 0% or maybe 1%. Do you have another instance running (or even in a zombie state)?

With a single instance actually running the cpu load for all services running on the machine is maybe 5%.
Reply
#6
i have i3 550 cpu - all cores are around or under 10% on idle - and CPU downclocks to 1200 Mhz.

Your CPU load could be influenced by CPU "strength" and by some system/video settings.

try and play with vertical sync and other setting, also full screen rendering of Xbmc can have impact on your system.
Reply
#7
I've done a bit of fiddling tonight to find out what's going on. There's only 1 xbmc process running and it's CPU load varies depending on what it's doing. For instance, on the home screen when "TV Shows" is highlighted, it uses 45% CPU. If you scroll across to "System" it only uses 12% CPU! Navigating around other menus shows a direct correlation between how much / different items are on screen and the CPU load.

So, I guess this is a valid CPU reading and not something strange! I've found out though that setting the screen to turn off the monitor reduces CPU load down to < 10%, which is good. However, since XBMC isn't used for 80% of the day, I think I'm going to get it to quit after 30 mins and see if I can get the launch script to wait for a remote control signal and start it up again. I'm sure I'll be posting about this problem soon!

Thanks for the help,
Max
Reply
#8
3 things to try -
1. disable the RSS feeds if you have them enabled
2. See if you have the common cache plugin installed under the addons, if so, disable it
3. Look into enabling dirty regions in the advancedsettings.xml (http://wiki.xbmc.org/index.php?title=Adv...ttings.xml)
Reply
#9
What GPU do you have, what driver are you using and is XBMC running in a windowed or full-screen session? From what you describe it kind of sounds like the CPU is doing all the work for your video sub-system. All of my machines have nVidia graphics hardware capable of doing most of the work.
Reply
#10
I've disabled the RSS and I've disabled the common cache plugin (it was causing a 100% spike every 7 seconds!) I will look into dirty regions later. For now, having the power saving turn the monitor off reduces the CPU to around 10% when idle.

The GPU is an Intel GM965/GL960 and it's on a laptop, so I'm not expecting much. It does seem as though the CPU is doing a lot of work for the rendering system.

I'm using Ubuntu 12.04 which seems to be using the generic driver that comes with Ubuntu, i.e. it's not a third party driver. It's running fullscreen in standalone mode. I've essentially replaced the desktop with XBMC. It's ran from a bash script which is a login option, so it's the only thing that's putting stuff on the screen. I.e., there's no desktop running at the same time.
Reply
#11
I suspect the GPU is your problem. As a test set your resolution as low as you can while still getting XBMC to work. I don't know what this is - 800x600 maybe. Then start XBMC and see if the CPU load drops. tf so you've found the problem and won't be able to fix it without opening your wallet...
Reply
#12
I'll try the resolution change tonight. I suspect you are right and the GPU just isn't great. However, as the idea was to make a new server / XBMC machine for no money I'm happy with the results. Setting the screen saver to turn off the monitor reduces the CPU a lot, and I will eventually get around to quitting XBMC and restarting on a remote press which will completely remove the problem.
Reply
#13
I just installed the Release version of Frodo on an AD12, and was seeing exactly the same issue. Not sure why, but disabling the RSS feed dropped CPU utilization from about 50% down to ~3%....

Reply

Logout Mark Read Team Forum Stats Members Help
45% CPU when idle0