You are not logged in.

#1 2010-05-13 06:39:56

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Excessive CPU use when running conky (conky ask for moc plugins)

Hello all. I just downloaded and installed conky-cli to show it in my default dwm statusbar. Everything worked out of the box, I checked the wiki for the instructions.

However the CPU use is around 15~20% after that, and I must say that is quite a lot for an idle machine. I commented the line that launches the conky in the .xinitrc and at the moment of writing this lines the CPU load is around 5% (with htop, Opera and 2 urxvt terminals open).

What could be possibly causing this? I guess that's something related to conky, but I just can't figure what. I used conky for so long on my desktop, and never had CPU loading issues. My .conkyrc is just like the wiki (i didn't edit it yet) and my .xinitrc doesn't contain anything weird (keymap set, fehbg and xcompmgr).

I'll research more on this subjet, almost 4am here

Thanks for reading and sorry for my english hmm

/EDIT: More relevant title

/EDIT2: Didn't labeled this as solved because the issue is still there.

Last edited by rb (2010-05-15 16:33:33)


Sorry for my English. Feel free to point out my errors.

Offline

#2 2010-05-13 09:44:27

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Excessive CPU use when running conky (conky ask for moc plugins)

afaik you don't need conky-cli anymore, there's an 'output to console' option in the regular conky these days

which .conkyrc from the wiki are you using? check your timings, xft settings, and whether you're not polling files or executing programs all the time (conky's built-in functions are much less consuming than executing "sudo hddtemp" 3 times per second)


ᶘ ᵒᴥᵒᶅ

Offline

#3 2010-05-13 17:42:38

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

This is my .xinitrc

#!/bin/sh

userresources=$HOME/.Xresources
#usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps
setxkbmap latam

#feh wallpaper
sh ~/.scripts/.fehbg &

#composite
xcompmgr -c &

#conky
conky | while read -r; do xsetroot -name "$REPLY"; done &

# start terminal emulation daemon
/usr/bin/urxvtd -q -o -f &

exec dwm

And this is my .conkyrc (just took the one in the wiki, and removed the mpd part and the second cpu core infp):

background no
out_to_console yes
update_interval 2
total_run_times 0
use_spacer none

TEXT
${cpu cpu1}% ${loadavg 1} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}

The weird thing is that htop (or top for that matter) shows me around 15~20% CPU load, but in the process list the highest consume of a single process (on idle) is lower than 1%, with almost every other process on 0.01%


Sorry for my English. Feel free to point out my errors.

Offline

#4 2010-05-13 19:57:01

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Excessive CPU use when running conky (conky ask for moc plugins)

the conky config looks alright, the top/htop levels suggests that there is something keeping your cpu's busy rather than producing real load. i'm not sure about this line:

conky | while read -r; do xsetroot -name "$REPLY"; done &

do you have dzen2 installed? if not try installing that along with the normal conky (instead of conky-cli), then call it with:

conky | dzen2

you can add these conky config parameters if you get double printouts:

out_to_stderr no
out_to_x no

ᶘ ᵒᴥᵒᶅ

Offline

#5 2010-05-13 20:46:46

schen
Member
Registered: 2009-06-06
Posts: 468

Re: Excessive CPU use when running conky (conky ask for moc plugins)

dwm uses xsetroot to pipe information to the statusbar, so the

conky | while read -r; do xsetroot -name "$REPLY"; done &

line is okay.

Offline

#6 2010-05-13 23:42:20

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

Thanks for you replies

I don't have dzen2 installed, my goal was to be able to populate the dwm status bar without any extra apps. Is this possibly anyway?

I remove conky-cli and installed conky. The CPU load is the same AND now I can't dump the conky info into the dwm statusbar. Instead the info is displayed in the lower right corner, overriding all apps. Here's a screen:

conky.png

The .xinitrc remains the same, and this is the .conkryrc file that I'm currently using:

# ~/.conkyrc
#
# set to true if you want Conky to be forked in the background
background no

# Print everything to stdout?
out_to_console yes

# Update interval in seconds
update_interval 2.0

# This is the number of times Conky will update before quitting, set to zero to run forever.
total_run_times 0

# Use double buffering (reduces flicker, may not work for everyone)
# double_buffer yes -> tried with and without, same result

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
$moc_file - $moc_timeleft | cpu: ${cpu cpu1}% | ram: ${memperc}% | network: ${upspeed wlan0} up, ${downspeed wlan0} down | temp: $acpitemp c | {battery_short} $battery_percent% | $time

I tested with a single line with $time$memperc and the time is displayed on the status bar, but the memperc is displayed in the desktop. I just can't figure what's that r like symbol that appears in the status bar and in the end of conky info in the desktop.

What I'm missing here? =/


Sorry for my English. Feel free to point out my errors.

Offline

#7 2010-05-14 01:52:17

schen
Member
Registered: 2009-06-06
Posts: 468

Re: Excessive CPU use when running conky (conky ask for moc plugins)

Have you piped conky to xsetroot? Here is my .conkyrc:

out_to_x no
out_to_console yes
update_interval 1.0
total_run_times 0
use_spacer none
TEXT
${time  %a %b %d %r %Z %Y} |Up:${uptime_short} |Temp:${acpitemp}C |Batt:${battery_short BAT1} |${addr wlan0} |RAM:$memperc% |CPU:${cpu}% | ${downspeedf wlan0}

Note that you don't have the out_to_X no.

Offline

#8 2010-05-14 02:16:38

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

I kept reading and looking signatures for config files. That's when I noticed that I've no 'out_to_x no' in the .conkyrc.  Was about to write this and my new findings.

I replaced the conky line in .xinitrc:

#conky
conky | while read line; do xsetroot -name "$line"; done &

This is my .conkyrc file now:

# ~/.conkyrc
#
# set to true if you want Conky to be forked in the background
background no

# Print everything to stdout?
out_to_console yes

# Print to X
out_to_x no

# Update interval in seconds
update_interval 2.0

# This is the number of times Conky will update before quitting, set to zero to run forever.
total_run_times 0

# Use double buffering (reduces flicker, may not work for everyone)
# double_buffer yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
${moc_file} - ${moc_timeleft} | cpu ${cpu cpu1}% | ram ${memperc}% | wan ${upspeed wlan0}up - ${downspeed wlan0}down | temp $acpitemp | ${battery_short} ${battery_percent}% | $time

It works now, at least is showed in the status bar. However, the CPU load is still around 20% and that weird symbol is showing up at the very right of the status bar (that weird r like character). What could possibly cause the CPU saturation? What's that symbol?

I'll keep reading and researching. I refuse to believe that this couldn't be done... despite the fact if I know some scripting I wouldn't be using conky in the first place haha

Thanks for your interest


/EDIT: I commented every single line in the .xinitrc but the conky and dwm lines. Still the same, CPU is around 15~20%

EDIT2: I found something that may be relevant. I just executed conky from a terminal, and the output was a loop of two errors:

Can't load plugin libmusepack_decoder: file not found
Can't load plugin libspeex_decoder: file not found
Can't load plugin libffmpeg_decoder: file not found

I'll search about this plugins, if they're needed and why I don't have them

Last edited by rb (2010-05-14 02:58:47)


Sorry for my English. Feel free to point out my errors.

Offline

#9 2010-05-14 17:32:30

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Excessive CPU use when running conky (conky ask for moc plugins)

the plugins are for moc i assume

if you comment out all the TEXT variables in .conkyrc and call it from the command line, it should produce very little load. if not, something really strange is going on..


ᶘ ᵒᴥᵒᶅ

Offline

#10 2010-05-14 18:32:17

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

Yep, those plugins (according the searchs outcome) are used by moc. What I don't understand, is why conky is asking for them. I searched a lot yesterday and I didn't found any related to conky + those pluings, only moc related issues (and my moc runs just fine).

I tested what you asked:

TEXT
#${moc_file} - ${moc_timeleft} | bla bla bla

Still is trying to load the plugins AND all the conky variables are displayed in console (along with the plugin load error)

I tested what you asked:

#TEXT
#${moc_file} - ${moc_timeleft} | bla bla bla

Conky: missing text block inf configuration; exiting

#TEXT
${moc_file} - ${moc_timeleft} | bla bla bla

Conky complains about ${moc_file} is not a configuration parameter, and then complains about TEXT block being inexistent (same as above)

I suppose I could install those plugins, but why sould I? I mean, I really don't see that as a solution but a cheap workaround (Windows anyone? lol)


Sorry for my English. Feel free to point out my errors.

Offline

#11 2010-05-14 18:40:53

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Excessive CPU use when running conky (conky ask for moc plugins)

Don't comment out the "TEXT".

Offline

#12 2010-05-14 18:50:02

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

I commented out the "TEXT" line just for testing.

I find very confusing the fact that when I commented out the (single) line below "TEXT" conky still output all the info to console. Shouldn't be running but with no output?

/EDIT: I found something else. When I run moc, I got the same errors but the sounds starts flawlessly. The ~/.moc/config looks good.

I might need to install those plugins, but I still don't know why. If they're truly needed, shouldn't be installed along with moc in the first place? There're a few post about this matters... I don't think is a common issue, isn't it?


Thanks for your replies guys!

Last edited by rb (2010-05-14 18:53:51)


Sorry for my English. Feel free to point out my errors.

Offline

#13 2010-05-14 18:55:51

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Excessive CPU use when running conky (conky ask for moc plugins)

you can remove the entire line below TEXT (just for testing) and see how the cpu load reacts. if it is low/normal, then try adding the variables one by one to see which variable causes the high load.

conky automatically detects changes in the config file, so you can try this out while it's running.


ᶘ ᵒᴥᵒᶅ

Offline

#14 2010-05-14 19:31:09

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

Nice one. I feel... ashamed. How I didn't think that before? haha

I remove all the variables and literals, and started conky with htop on a different terminal. CPU load was about 2%, nice. Then added all the variables one bye one but ${moc_file} and ${moc_timeleft}. Still 2% load, and the conky behaves well. I added ${moc_file} to the variables and... guess what? CPU loads fire up to 20% and the pluings error flooded my terminal.

What I still don't understand, is why if those plugins are required by moc wasn't installed along with moc in the first place. I mean, the program runs and play the music correctly but still give me that error when i starts. Could this be a problem with my particular installation, or something more general? I ask because moc isn't that popular and maybe this overlooked?

Thanks for your interest and patience =)


/EDIT: Now it's time to install those plugins and try what happens

/EDIT2: I installed the plugins, and now moc doesn't give any error at startup. Conky, in the other hand, how fires up the CPU consumption up to 60%!!! Of course the plugin error is gone, but... 60%? come on, that's really weird haha

Last edited by rb (2010-05-14 20:08:56)


Sorry for my English. Feel free to point out my errors.

Offline

#15 2010-05-14 20:47:35

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Excessive CPU use when running conky (conky ask for moc plugins)

those plugins are listed as optional by pacman, apparently the maintainer decided they weren't needed for basic operation. if like you say moc displays them as missing on startup, you can open a bug report and ask the maintainer to include them by default. i assume they would make the download a lot bigger, so there would be a tradeoff there ofcourse.

about the high cpu, what might be happening is that conky needs to fire up moc every 2 seconds to get it's output, so that produces quite some load. you can try lowering the update interval to 5-10 seconds. i use mpd/mpc here with a 5 second interval, and the load is negligible (1-2% on a 2.13ghz machine).

Last edited by litemotiv (2010-05-14 20:49:02)


ᶘ ᵒᴥᵒᶅ

Offline

#16 2010-05-14 20:58:55

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Excessive CPU use when running conky (conky ask for moc plugins)

I'll submit a bug report if that's the case.

I guess that I'll live without the song name in the statusbar. Not a big deal tho haha

Thanks again


Sorry for my English. Feel free to point out my errors.

Offline

#17 2010-09-07 16:32:56

kismet010
Member
Registered: 2009-09-02
Posts: 137

Re: Excessive CPU use when running conky (conky ask for moc plugins)

a year ago built-in script for moc use ~20% cpu, so i used:

${execi 10 if ps aux | grep [m]ocp >> /dev/null; then mocp -i | grep SongTitle | cut -f2 -d :; fi}

now i check again and it's seems they maked some work beacause only use 4-5%. mpd only use around 1%

Offline

Board footer

Powered by FluxBB