This is a quick summary of all the information about my Raspberry Pi Stockfish Cluster (all posts). For more detailed setup instructions, see Creating a Stockfish Cluster.

Raspberry Pi Cluster

Over the past month or so, I’ve been working on building a server cluster to run the Stockfish chess engine. This is 4 small computers together that act like one single more powerful computer. I did this partly because I wanted a dedicated remote chess engine to connect to, and partly because I wanted to see if I could build a cluster using Raspberry Pi mini computers.

Hardware

The cluster consists of 4 Raspberry Pi Model 4B computers. Each Raspberry Pi has a 1.5GHz Quad-core ARM processor. These are the latest available Raspberry Pi and cost about $35 each for the computer. There are other costs involved (SD cards, power supplies, etc) that I detail in my post on cluster parts. The whole thing was less than $250.

I had some Raspberry Pis that I repurposed from other projects, and some that I bought. I had some of the other equipment as well, so my total price was much less.

All the Raspberry Pis are networked together and in a cute case.

I did overclock the Raspberry Pis to get slightly better performance.

Overview

The basic system looks like this

graph TD local(Chess Database)-->ssh(SSH) ssh-->master(Raspberry Pi Master Node) master-->child1(RPi Worker) master-->child2(RPi Worker) master-->child3(RPi Worker)

The communication happens to the “master” node, which coordinates with all the worker nodes to do the processing together.

Software

Obviously this runs Stockfish. However, it is a custom build of stockfish that is made specifically for a cluster environment. For the full setup process, you can read my more detailed post about the stockfish cluster.

The communication within the cluster uses OpenMPI. This is the magic that makes the 4 computers work together.

Performance

Using the built-in performance benchmark, I get results around 2 MN/s (2,000,000 nodes per second).

I was hoping this would compete with a single dedicated chess server, or even be comparable to running on my laptop (9 MN/s). Spreading the processing load over 16 cores (4 computers with quad-core processors) in theory should be fast. No such luck. One issue is that each Raspberry Pi is not as powerful as most modern CPUs. But that is by design and the reason they are $35. Another issue is network latency communicating between the cluster nodes, which you would not have with a single, more powerful, computer.

Is it Worth It?

If you just want a dedicated server to run a chess engine with the highest performance, there are better options than a Raspberry Pi cluster. For $250, which is about the cost of all the parts, you could also probably find a used computer that would perform better. For example, I recently bought a chromebook for my family for about that price that performs at about 3 MN/s. And yes, the first thing I did with the new chrromebook was install stockfish on it.

You could also look into a cloud-based stockfish solution. For me that provides a better balance between great performance and low cost.

That said, this was a very fun project. Having a remote server, raspberry pi or otherwise, is great for analyzing games as it does not drain you laptop battery. I am not a grand master looking to find the latest theoretical line, I just want to review my games and see what I should have done instead of blundering.