Bitcoin Forum
September 28, 2016, 03:28:19 AM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: "screensaver" mode  (Read 1311 times)
singpolyma
Jr. Member
*
Offline Offline

Activity: 43



View Profile WWW
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. Advertise here.
1475033299
Hero Member
*
Offline Offline

Posts: 1475033299

View Profile Personal Message (Offline)

Ignore
1475033299
Reply with quote  #2

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

Activity: 410


minor developer


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.

teknohog
Sr. Member
****
Offline Offline

Activity: 410


minor developer


View Profile WWW
September 07, 2010, 02:37:48 PM
 #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

nimnul
Sr. Member
****
Offline Offline

Activity: 255


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!