Bitcoin Forum
April 19, 2024, 08:44:04 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "screensaver" mode  (Read 7563 times)
singpolyma (OP)
Full Member
***
Offline Offline

Activity: 546
Merit: 101



View Profile
September 06, 2010, 11:40:13 PM
 #1

I've been running bitcoind in the background (genproclimit'd to half my cores) for the past while, and it's mostly been fine, but today I tried to play an HD video with VLC and my system overheated and shut down after 10-15 minutes.  I got to thinking: it would make more sense if bitcoind only ran generation when the system was idle, and then it could run at 100%

Is this feasible at all?  I guess I could write some cronjob that checks CPU activity and turns on/off the daemon... not sure)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713516244
Hero Member
*
Offline Offline

Posts: 1713516244

View Profile Personal Message (Offline)

Ignore
1713516244
Reply with quote  #2

1713516244
Report to moderator
1713516244
Hero Member
*
Offline Offline

Posts: 1713516244

View Profile Personal Message (Offline)

Ignore
1713516244
Reply with quote  #2

1713516244
Report to moderator
1713516244
Hero Member
*
Offline Offline

Posts: 1713516244

View Profile Personal Message (Offline)

Ignore
1713516244
Reply with quote  #2

1713516244
Report to moderator
teknohog
Sr. Member
****
Offline Offline

Activity: 519
Merit: 252


555


View Profile WWW
September 07, 2010, 01:44:58 PM
 #2

it would make more sense if bitcoind only ran generation when the system was idle, and then it could run at 100%

Is this feasible at all?  I guess I could write some cronjob that checks CPU activity and turns on/off the daemon... not sure)

Seti@Home was originally a screensaver application, so the entire program started and stopped like any other screensaver. But Bitcoin needs to be running all the time for the network to function.

Therefore, the screensaver could be a script that runs "bitcoind setgenerate true" as it starts. The script then stays in an idle loop, and when the screensaver turns off , it catches the termination signal and runs "bitcoind setgenerate false". Or do the equivalent using JSON-RPC, which is a little more elegant, as it does not need execute permissions for bitcoind itself. This should be easy to do in Linux, I'm not sure about other systems.

world famous math art | masternodes are bad, mmmkay?
Every sha(sha(sha(sha()))), every ho-o-o-old, still shines
teknohog
Sr. Member
****
Offline Offline

Activity: 519
Merit: 252


555


View Profile WWW
September 07, 2010, 02:37:48 PM
Last edit: September 07, 2010, 03:07:46 PM by teknohog
 #3

Actually, I only use simple screen blanking in Linux, set via xset. I have also used xset to monitor the display status, this only needs a script running constantly in the background. Here, when the display turns off, bitcoin generation is turned on, and vice versa.

Code:
#!/bin/bash

CMD="/home/teknohog/distr.projects/bitcoin-svn/bitcoind setgenerate"

OLD_STATE=""

while true; do
    STATE=`DISPLAY=:0 xset q | grep Monitor | awk '{print $3 $4}'`

    # Collapse all "off" states into one
    case $STATE in
        inStandby|inSuspend|Off)
            STATE=Off
            ;;
    esac

    # Only run the command when the display state changes:
    # on to standby -> start generating
    # standby to on -> stop generating

    if [ "$OLD_STATE" == "On" ] && [ "$STATE" == "Off" ]; then
        $CMD true
    elif [ "$OLD_STATE" == "Off" ] && [ "$STATE" == "On" ]; then
        $CMD false
    fi

    OLD_STATE=$STATE

    sleep 1
done

world famous math art | masternodes are bad, mmmkay?
Every sha(sha(sha(sha()))), every ho-o-o-old, still shines
nimnul
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile WWW
September 08, 2010, 07:32:32 PM
 #4

Last time I checked (that was fairly long time ago, around 2006) Seti@Home used BOINC infrastructure. That middleware has advanced means of controlling CPU usage, supports automatic signed updates for all platforms and has many other sweet features,  but unfortunately it's centralized and we cannot use it as is. But maybe we can develop an alternative client able to work under control of BOINC, so people can for example specify how much CPU they dedicate for BTC and how much for Seti@Home and other BOINC projects.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!