climateprediction.net (CPDN) home page
Thread 'what determines idle/in-use: detecting remote activity so boinc will suspend'

Thread 'what determines idle/in-use: detecting remote activity so boinc will suspend'

Questions and Answers : Unix/Linux : what determines idle/in-use: detecting remote activity so boinc will suspend
Message board moderation

To post messages, you must log in.

AuthorMessage
old_user54159

Send message
Joined: 11 Feb 05
Posts: 4
Credit: 32,274
RAC: 0
Message 13257 - Posted: 8 Jun 2005, 20:33:09 UTC

I set boinc to suspend when my linux machine (ubuntu 5.04/Gnome) is in use. It suspends just fine when I sit down at the display and use the mouse/keyboard/whatever. But I also log into remotely via ssh/x11 and use firefox, shell commands, et al.

How does boinc detect when the machine is \"idle\"? Is there a way to get either linux/gnome or boinc to realize the machine is in use by watching for remote activity? Or can I run some sort of program to say \"hey boinc - I\'m using it now, back off for 20 minutes\"?

ID: 13257 · Report as offensive     Reply Quote
Profileold_user248

Send message
Joined: 6 Aug 04
Posts: 65
Credit: 1,605,224
RAC: 0
Message 13359 - Posted: 12 Jun 2005, 10:42:57 UTC
Last modified: 12 Jun 2005, 10:43:59 UTC

Nealmcb:

boinc and climate predcition under Linux use the nice levels. Boinc defaults to a nice level of 19 which is the lowest (man nice for more information). This means that if almost anything happens on your system your kernel will give the processing power over to the other applications preferentially over boinc.

Under Windows boinc uses a normal priority and the distributed computing apps (eg CP) have a priority set to the lowest. There was a discussion on the at the end of 2004 in reference to CP classic if you want to try searching the other message board for more information.

DaveN
ID: 13359 · Report as offensive     Reply Quote
old_user54159

Send message
Joined: 11 Feb 05
Posts: 4
Credit: 32,274
RAC: 0
Message 13364 - Posted: 12 Jun 2005, 13:57:33 UTC - in response to Message 13359.  

> boinc and climate predcition under Linux use the nice levels. Boinc defaults
> to a nice level of 19 which is the lowest (man nice for more information).
> This means that if almost anything happens on your system your kernel will
> give the processing power over to the other applications preferentially over
> boinc.

Thanks, setting "nice" levels would help with CPU contention.

But my issue, which seems much more common these days, is memory contention.
Performance is terrible when boinc is forcing other applications to use a lot of swap space. So I set this preference to "no": "Leave applications in memory while preempted? (suspended applications will consume swap space if 'yes')"

But that doesn't kick in unless boinc actually gets suspended, so I really want boinc to notice when I'm actively using other applications, and to start back up when that activity ceases. The trick is how to get boinc to notice remote activity. I'd even settle for a way to manually say "suspend for an hour" or something like that. But I don't want to have to remember to restart boinc.

ID: 13364 · Report as offensive     Reply Quote
ProfileThyme Lawn
Volunteer moderator

Send message
Joined: 5 Aug 04
Posts: 1283
Credit: 15,824,334
RAC: 0
Message 13407 - Posted: 13 Jun 2005, 11:04:13 UTC - in response to Message 13364.  

> But my issue, which seems much more common these days, is memory contention.
> Performance is terrible when boinc is forcing other applications to use a lot
> of swap space. So I set this preference to "no": "Leave applications in
> memory while preempted? (suspended applications will consume swap space if
> 'yes')"

The only option that gets anywhere close to what you're asking for is the % virtual memory space limit in general preferences, but that includes both physical memory and swap space. BOINC and CPDN should be using no more than 50 of your 250MB. I doubt if it'll have any effect, but you could try reducing the limit to 20 or 25.
<br><a href="http://www.teampicard.net/"><img src="http://www.teampicard.net/images/picardmini.gif"></a><a href="http://climateapps2.oucs.ox.ac.uk/cpdnboinc/team_display.php?teamid=3">Join us here</a>
ID: 13407 · Report as offensive     Reply Quote
old_user54159

Send message
Joined: 11 Feb 05
Posts: 4
Credit: 32,274
RAC: 0
Message 13414 - Posted: 13 Jun 2005, 15:19:11 UTC - in response to Message 13407.  

&gt; The only option that gets anywhere close to what you're asking for is the %
&gt; virtual memory space limit in general preferences, but that includes both
&gt; physical memory and swap space. BOINC and CPDN should be using no more than
&gt; 50 of your 250MB. I doubt if it'll have any effect, but you could try
&gt; reducing the limit to 20 or 25.
&gt; <br><a href="http://www.teampicard.net/"><img> src="http://www.teampicard.net/images/picardmini.gif"&gt;</a><a> href="http://climateapps2.oucs.ox.ac.uk/cpdnboinc/team_display.php?teamid=3"&gt;Join
&gt; us here</a>

My goal is to get boinc to suspend and automatically resume later on, not to hobble it when I'm not around. I'm guessing that the answer lies in a lower layer, something in GNOME or X11, that lets a user do the equivalent of pretending to move the mouse or type on the keyboard, such that boinc would notice that. What would help is an indication of what function boinc calls to detect "idle" activity on Linux, so I can find documentation on that API.

ID: 13414 · Report as offensive     Reply Quote
Arnaud

Send message
Joined: 3 Sep 04
Posts: 268
Credit: 256,045
RAC: 0
Message 13420 - Posted: 13 Jun 2005, 19:07:14 UTC
Last modified: 13 Jun 2005, 19:12:22 UTC

Using a VNC connexion will enable you to suspend boinc when you move your mouse/keyboard.
Of course it's not as secure as an ssh connexion, but it works fine for me.
But Boinc is really "invisible" with Linux, so I don't really see the point of suspending it to use Firefox or shell/etc.
ID: 13420 · Report as offensive     Reply Quote
ProfileThyme Lawn
Volunteer moderator

Send message
Joined: 5 Aug 04
Posts: 1283
Credit: 15,824,334
RAC: 0
Message 13421 - Posted: 13 Jun 2005, 19:21:48 UTC - in response to Message 13414.  

&gt; What would help is an indication of what function boinc calls to detect "idle"
&gt; activity on Linux, so I can find documentation on that API.

It calls stat(2) for the mouse and all tty devices and checks that the idle period set in your general preferences has elapsed between the current time and 'st_atime' for all of them.

If you use the command-line parameter '-check_all_logins' the check will be on the device for each login.

<br><a href="http://www.teampicard.net/"><img src="http://www.teampicard.net/images/picardmini.gif"></a><a href="http://climateapps2.oucs.ox.ac.uk/cpdnboinc/team_display.php?teamid=3">Join us here</a>
ID: 13421 · Report as offensive     Reply Quote
old_user54159

Send message
Joined: 11 Feb 05
Posts: 4
Credit: 32,274
RAC: 0
Message 13455 - Posted: 14 Jun 2005, 23:23:51 UTC - in response to Message 13421.  

&gt; If you use the command-line parameter '-check_all_logins' the check will be on
&gt; the device for each login.

Excellent - now that I think of it, I remember that - thanks.
Running it that way, all I have to do is log in via another ssh
connection and interact with a shell there, and boinc frees up its memory and goes away for 20 minutes.

I did notice that it isn't enough to type something in a window that isn't listening to me yet (e.g. in a window that is doing a "tail" on the log file). Which makes sense, since it is the "access" time, not the "write" time, that is being checked. So the shell (or htop, or something else) has to actually read the characters I type....

Now I'm a happy camper again, able to let it run without it getting my way too much, though it still does take some time for other applications to get their memory pages back in main memory. Firefox can get huge, e.g. 230 MB, when I have a few dozen tabs open (as is my habit :-), so taking 20 or 50 MB can make a difference.

ID: 13455 · Report as offensive     Reply Quote

Questions and Answers : Unix/Linux : what determines idle/in-use: detecting remote activity so boinc will suspend

©2024 cpdn.org