CPU plugin

Suggest, post, or discuss plugins for Deluge
Post Reply
Stupot
New User
New User
Posts: 3
Joined: Fri Nov 02, 2007 2:36 am

CPU plugin

Post by Stupot »

I did a search on this forum and didn't see anything like this. If it's been suggested before, then I apologize.

I often come and go from my computer and it's not on a specific schedule, so the scheduler plugin doesn't perfectly fit my situation. My idea is to have deluge download more or less based on CPU %. If the CPU % is below a certain threshold (set by user) then deluge is allowed to download/upload to the max. If the CPU % is above the threshold, then deluge will work at a slower speed (set by user). Obviously, there is a lot more overhead (timer mechanisms etc) that would need to be implemented. The question is, does anyone else think this idea is worth exploring? Perhaps instead of CPU % it should look at something different (i.e. internet speed or a combination?) Suggestions to this idea are welcome. I think deluge is the utorrent of linux and I love it.
daddy
Seeder
Seeder
Posts: 100
Joined: Sun Jul 22, 2007 12:14 am

Re: CPU plugin

Post by daddy »

Not CPU. What about expensive screen savers? Cron jobs? Lots of people try to run computationally expensive tasks while they aren't at their computers... Honestly, I wouldn't be surprised if my mean CPU load is higher when I'm *not* at my computer than when I am.

If I were you I would look for a way to hook into gnome-screensaver, but that would be specific to gnome. And would assume that the user runs a screen saver (IIRC, blank is a screen saver, but it would be possible to circumvent by setting the inactivity timer to >= the power management timer). I think it uses .desktop files for information about the screensaver. Maybe you could write a script that resumes downloads in deluge (DBus, anyone) before launching the screen saver, and change the .desktop file to run that instead. Or maybe gnome-screensaver emits something on the session bus that you can watch for from a plugin.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: CPU plugin

Post by johnnyg »

ssokolow wrote:As a KDE user, I'd advise against relying on something like gnome-screensaver. Why not check how the auto-away options in Kopete and Pidgin monitor "X activity"?
I'm pretty sure Pidgin (and I'm presuming Kopete as well) monitor "X activity" by an absence of mouse or keyboard activity, i.e. if you haven't moved your mouse or touched your keyboard after 10min, then you're "away".

what you're after is sort of a nice mode for deluge (man nice if you don't know what I mean). When a computer is idle, it will run programs with lower priorities, so if you could somehow associate deluge's speed limiting with priority level then you'd have what you're after.

if however you only want deluge to download/upload at maximum capacity when you're away because you don't want it affecting your web browsing then you might be better looking at speed limiting based on network activity, that would probably be easier to implement.
dknowles

Re: CPU plugin

Post by dknowles »

Why not just set the nice level for deluge?

http://en.wikipedia.org/wiki/Nice_(Unix)

This should make deluge play nice (pun sort of intended) when you're doing other tasks on your computer, but it should still be able to eat away at cpu cycles if you're not there.

(also see: http://usr-share-man.org/man1/nice.html)
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: CPU plugin

Post by johnnyg »

dknowles wrote:Why not just set the nice level for deluge?

http://en.wikipedia.org/wiki/Nice_(Unix)

This should make deluge play nice (pun sort of intended) when you're doing other tasks on your computer, but it should still be able to eat away at cpu cycles if you're not there.

(also see: http://usr-share-man.org/man1/nice.html)
running deluge with the lowest nice priority doesn't seem to affect its speed at all.

as I mentioned before you'd need a pseudo nice which directly relates priority to max speed.
Post Reply