System lag every minute or so

Bug #1176445 reported by Paul Merrill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Variety
Invalid
Undecided
Unassigned

Bug Description

I notice with Variety running that periodically it seems like every minute or so the system hangs and then returns. If I'm watching a video it freezes for a second, if I'm typing the keyboard becomes unresponsive for a second and then comes back. If I stop Variety the problem disappears. I have a quad core processor with 4GB of ram so I doubt it's a CPU problem.

Latest version of variety 0.4.13, Linux Mint 14 Cinnamon Desktop

Revision history for this message
Paul Merrill (paul-a-merrill) wrote :

Just checked with system monitor and it peaks every 60 seconds and can suck as much as 80% of the CPU on an idle system. I've also niced the process to very low with no impact, still get the lags.

Revision history for this message
Paul Merrill (paul-a-merrill) wrote :

Did a bit more checking, suspected the clock and turned the clock display off and it fixed the problem. So for some reason the clock display changing every minute causes a huge spike in CPU and a lag of the processes. It may be the way it's implemented or the way it interacts with the X-Windows systems. I'm running the Nvidia display drivers as well.

It also seems to lag every 5 minutes, when I've asked it to change the desktop. While it could be the Nvidia drivers it could also be the way variety is written. Perhaps you fork off processes and don't put them at low priority?

Revision history for this message
Peter Levi (peterlevi) wrote :

Changing the wallpaper (with clock and quotes off) is achieved by an externally-run bash script (~/.config/variety/set_wallpaper) which sets the gsettings background property and from there the gnome-settings-daemon picks up, then Nautilus (or whichever program is set to draw the desktop) updates the desktop. The bash script itself is fairly trivial, so it shouldn't be a problem itself, but then the actual refresh of the wallpaper may cause spikes if something with the configuration of X or compositing is wrong or misbehaving.

With clock display on, Variety spawns an ImageMagick process every minute to update the clock and then performs again the wallpaper refresh procedure described above. It's true I'm not putting the ImageMagick process at low priority, this should be looked into, but I doubt this is the main reason in your case - I suspect it is the refresh of the wallpaper again, it just happens more often now.

There are several things you could do to pinpoint the culprit more correctly:
1. Set Variety to change every, say, 10 seconds, run top and manually check which process spikes during changes and accumulates a higher CPU time after some time - variety, gnome-settings-daemon, nautilus, compiz, etc. On my machine these seem to be nautilus and compiz, reaching about 20% CPU usage on change.
2. Manually change the wallpaper from the settings quickly several times in a row, do you see the same spikes?

Revision history for this message
Peter Levi (peterlevi) wrote :

Note: the ImageMagick command is "convert"

Revision history for this message
Peter Levi (peterlevi) wrote :

Correction: the script is located at ~/.config/variety/scripts/set_wallpaper

Peter Levi (peterlevi)
Changed in variety:
status: New → Incomplete
Revision history for this message
Paul Merrill (paul-a-merrill) wrote :

I ran system monitor and changed the wallpaper manually. The exact same spikes occur. The monitor stops and then there is a spike indicating 60% cpu used for about a second.

Revision history for this message
Peter Levi (peterlevi) wrote :

By manually do you mean via Mint's appearance settings or manually from inside Variety?
By "manually" in my comment above I meant via Mint's appearance settings, so as to confirm or exclude Variety as part of the problem.

Revision history for this message
Paul Merrill (paul-a-merrill) wrote :

I click on the variety icon in mint's bottom toolbar and select to have the next wallpaper. The CPU goes to 60% and finally the wallpaper gets displayed about a second after I press the next.

Revision history for this message
Peter Levi (peterlevi) wrote :

Ok, please do try the two suggestions above, especially manually changing the wallpaper from Mint's settings while monitoring for CPU spikes. Up till now we can't know if it's Variety or the system redrawing the wallpaper that is causing the spikes.

Revision history for this message
Paul Merrill (paul-a-merrill) wrote :

I changed the wallpaper manually via desktop NOT through variety and it created the same spike. So it's either the routine that changes the image or the nvidia graphics driver. Thus, I don't think it's variety's fault. However, it's still a pain.

Revision history for this message
Peter Levi (peterlevi) wrote :

Something is probably off with your video configuration. Personally I've always found the support of both nvidia and ATI cards in Linux close to terrible, that's why for my latest laptop I specifically bought an integrated Intel video card.

Maybe it's possible to turn off the fancy smooth compiz effects for changing the wallpaper, so that it changes immediately with no transition, I suppose this would reduce the load during changes.

Changed in variety:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.