Two years ago, when a colleague had root access to our lab's SUN 4500s (8 processors each, each running at 500mhz), we decided that all those spare processor cycles were going to waste. With his knowledge of UNIX calls and my affinity for perl, we came up with a SETI runner which fired up new instances when the system was idle, and killed instances when the system load went up. my $uptime = "uptime"; # or whatever it's called... my $setiRoot = '/usr/bin/seti'; my $setiBinary = 'setiathome'; my $setiFlags = ''; my $setiLog = 'seti.log'; my $napTime = 2; my $maxInstances = 8; # maximum number of SETI instances my $minInstances = 0; # minimum number of SETI instances my $lowThreshold = 8.00; # start SETI my $hiThreshold = 9.00; # stop SETI my @setiPids; # pid array while(1) { sleep( $napTime ); my $uptime = `$uptime`; $uptime = $1 if $uptime =~ /load average: (\d+\.\d\d)/; print STDERR "load average: $uptime\n"; # # if the uptime is below a certain load, # then fire up a new SETI instance. # &startSETI if ( ($uptime < $lowThreshold) && (@seti < $maxInstances) ); # # if the uptime is above a certain load, # then kill a SETI instance. # &stopSETI if ( ($uptime > $hiThreshold) && (@seti > $minInstances) ); } # # Organize our list of PIDs # sub startSETI { print STDERR "Firing up a SETI...\n"; print STDERR "We have ", scalar( @setiPids ), " PIDs:\n"; print STDERR join( " ", @setiPids ), "\n"; # list all processes my $number = scalar( @setiPids ); chdir( "$setiRoot/seti$number" ); print STDERR "Working directory: $setiRoot/seti$number\n"; push( @setiPids, `$setiBinary $setiFlags > $setiLog` ); } # # Quick and dirty killer # sub stopSETI { print STDERR "Shutting down a SETI...\n"; kill 9, pop @setiPids; }