How to Science the Shit Out of Your Server
When I was a kid, I had to walk barefoot 10 miles to the basement, pull the faux-leather dust cover off the terminal, crank up the Tesla coil, and run my applications locally. Crazy, right? Clouds were just fuzzy white blobs used to sell toilet paper and salvation.
My first introduction to the concept of distributed computing came in the form of a screensaver called SETI@home, first released to the public 18 years ago this very day. By 1999, personal computers had gotten big — like 16-24MB of RAM big! — with power to spare. Some futurists noticed this and thought, What a waste it is to spend idle moments propelling toasters through space. Let’s give them purpose. And so they did. Net-connected computers running SETI@home instead spent their downtime analyzing small pieces of the mountains of data being collected by SETI’s array of radio telescopes. No super computer on Earth could have kept pace. But millions of modest, consumer models? Sure.
In 2004, the infrastructure behind SETI@home was opened up to accommodate other research projects and rechristened Boinc. In the years since, the number of projects volunteers can choose from have exploded. Don’t care about E.T.? Donate some computing time to protein folding or prime number generation or language analysis instead. (You can find a more specific list of projects here.)
Me, well, I’ve stuck with SETI all these years. I’m not too happy living in a world without Carl Sagan, but remain hopeful that, just maybe, out there among the billions and billions of inhabitable worlds, we’ll find some sage flying octopus monster proximity.
Your Server Isn’t Doing Much
So it turns out, this Internet thing everyone’s talking about so much is run almost entirely by computers (with a bit living in the mind of レイン). And a lot of these computers, particularly fixed-resource VPSes, are often just sitting on their thumbdrives, potential unfulfilled, waiting for a DDoS attack or spike in customer traffic to show up and give them a workout.
While the versions of Boinc installed on most desktops and laptops have a nice GUI interface, there are builds without any X dependencies that are perfect for deployment to server environments. To install Boinc on a Debian-based server, for example, type:
# Install headless Boinc apt-get install boinc-client # Attach a project to it. The "xxx" is where you would plop the hash # corresponding to your account with the project. (That should be # under your account settings on the project site.) # The following uses SETI@home's URL, but if you're running a # different project, replace that too. boinccmd --project_attach http://setiathome.berkeley.edu xxx
Boinc project settings are managed en masse through the project’s web site. Each instance you install and connect will download those settings and roll with them. But if you need to do something different for a given server, just pop open
/etc/boinc-client/global_prefs_override.xml and insert any instance-specific overrides you want. (For reference, take a look at the settings actually being used in
/var/lib/boinc-client/global_prefs.xml.) To apply the changes, run:
Headless Boinc is pretty light on RAM and network, but will eat as much CPU as you’re willing to give it. I recommend starting with a modest limit, something like access to half your CPU cores, and no more than 20% of their total cycles. Monitor things for a day or week, increase or decrease as needed.
Do that for the next 18 years and who knows, maybe you’ll help find out the question behind the answer to life, the universe, and everything.