Donating CPU cycles to BOINC




As you know, I recently moved my blog to DigitalOcean and setup SSL. I’m currently using the $10/month DigitalOcean plan, which consists of 1 CPU core, 1GB RAM, 30GB disk, and 2TB transfer. Unfortunately, I’m not getting my money’s worth with this server. While it does run 24/7, it doesn’t spend 100% of its time serving pages. Typically, my htop console looks like this.

CPU[|                                                                    0.7%]     Tasks: 38, 30 thr; 2 running
Mem[||||||||||||||||||||||||||||||||||                              231/994MB]     Load average: 0.10 0.18 0.22
Swp[                                                                 0/2047MB]     Uptime: 03:11:24

As you can see, Nginx keep my RAM usage down (compared to Apache), but the CPU very rarely spikes (unless I’m doing an application upgrade or a backup). As such, I’m going to donate my spare CPU cycles to BOINC.

What is BOINC?

BOINC, short for Berkeley Open Infrastructure for Network Computing, is an open-source middleware system for volunteer and grid computing. The BOINC client allows your computer to work on very small pieces of very large projects during its idle time. These projects include searching for extraterrestrial life, searching for pulsars, determining 3-dimensional shapes of proteins, climate modeling, solving RC5 ciphers, finding new prime numbers, mining bitcoin, and many more. Because most of these projects are based in academia, volunteer computing offers an alternative to purchasing expensive supercomputing units in data centers.

The BOINC client connects to the project’s website, downloads the necessary files, does the work locally, then uploads the results. Based on the work done, credit is earned. While credit doesn’t have any monetary value, it serves as a way to inspire competition and also serves as personal recognition of work completed.


BOINC is licensed under the LGPL and is available for Microsoft Windows, Mac OS X, Android, Linux and FreeBSD.


Install BOINC

Setting up BOINC is very easy on Ubuntu server, as it’s already in the repositories and BOINC has a quick install guide. On a headless machine, install the client.

sudo apt-get install boinc-client

If you’re using a GUI, install the front-end application as well.

sudo apt-get install boinc-manager

If you’re using a GPU instead of a CPU, look at this page. GPU computing can sometimes be 200x faster than CPU computing.

Configure the client

Create account

First, you’ll need to setup an account to earn credit. The syntax to do this from the command line is below.

boinccmd --create_account URL email password username

I’m using Asteroids@home (determining 3-dimensional shapes of asteroids), so my account creation string will look like this.

boinccmd --create_account p@ssw0rd username

When run, you should receive an account key (shown below). Save this for the next step.

status: Success
poll status: operation in progress
poll status: operation in progress

Finally, attach to a project using your account key.


Configure settings

By default, BOINC will use 100% of available CPU. I’m going to dial that down to 75%, as well as set some other options. First, we’ll need to stop the client so we can make a few changes.

sudo service boinc-client stop

There are two ways to edit the preferences of the BOINC client:

  • Edit your preferences on your project’s website (this is great if you have multiple PCs/servers running the same project)
  • Edit the /etc/boinc-client/global_prefs_override.xml file, which will override any preferences set online

In addition, some projects also support the option to edit location-specific preferences (e.g., you have one PC at work and one at school). Here, I’m going to be setting my preferences in my Asteroids@home account online.

Once you’ve updated your preferences, start the client, the update the client with preferences from the server.

sudo service boinc-client start
for url in $(boinccmd --get_project_status | sed -n 's/\s*master URL: //p'); do boinccmd --project ${url} update; done

Check status

Depending on your preferences, you’ll probably need to wait a few minutes for BOINC to start on a task. Even then, it will probably need to download files to work on. In the meantime, here are some helpful commands.

Command Description
boinccmd --help Shows all possible commands
boinccmd --create_account <URL> <email> <password> Create account
boinccmd --lookup_account <URL> <email> <password> Lookup account key
boinccmd --project_attach <URL> <account_key> Attach to a project
boinccmd --project <URL> detach Detach from a project
boinccmd --project <URL> update Update project (pulls preferences from website settings)
boinccmd --get_host_info Show system information about the host where the BOINC client is running
boinccmd --get_disk_usage Show disk usage of all projects
boinccmd --get_file_transfers Show all current file transfers
boinccmd --get_project_status Show status of all projects
boinccmd --get_tasks Show all tasks of the client
boinccmd --get_simple_gui_info Show status of projects and active tasks (same as get_tasks and get_project_status)
boinccmd --get_daily_xfer_history Show network traffic history of the BOINC client
boinccmd --get_state Show complete client state


Looking at htop, you can see my CPU usage now that BOINC is running.

CPU[|||||||||||||||||||||||||||||||||||||||||                           53.6%]     Tasks: 39, 32 thr; 3 running
Mem[|||||||||||||||||||||||||||||||||||                             237/994MB]     Load average: 0.24 0.25 0.23
Swp[                                                                 0/2047MB]     Uptime: 02:57:19




Leave a Comment