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.
CPU plugin
Re: CPU plugin
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.
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.
Re: CPU plugin
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".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"?
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.
Re: CPU plugin
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)
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)
Re: CPU plugin
running deluge with the lowest nice priority doesn't seem to affect its speed at all.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)
as I mentioned before you'd need a pseudo nice which directly relates priority to max speed.