This is a Raspberry Pi compute module. And this is a stack of seven Raspberry Pi compute modules.
It's the same thing as a Raspberry Pi model B, but it drops all the I/O ports to make for a
more flexible form factor, which the Raspberry Pi foundation says is suitable for industrial
applications. But in my case, I'm interested in using it to build a cluster of Raspberry
Pis. I'm going to explore the concept of cluster computing using Raspberry Pis,
and I'm excited to be in possession of a game-changing Raspberry-Pi-based cluster board:
the Turing Pi. I'll get to the Turing Pi soon, but in this first episode I wanted to cover why I love
using raspberry PI's for clusters. But first, what is a cluster? a lot of people try to solve
complex problems with computers. Sometimes they do things like serve a webpage to a huge amount
of visitors. This requires lots of bandwidth and lots of back-end computers to handle each of the
millions of requests. Some people, like weather forecasters, need to find the results of billions
of small calculations there are two ways to speed up these kinds of operations: first,
by scaling vertically, where you have a single server and you put in a faster CPU, more RAM,
and faster connections; second, by scaling horizontally, where you split up the tasks
and use multiple computers. Early on, systems like Cray supercomputers took vertical scaling to the
extreme. One massive computer that cost millions of dollars was the fastest computer for a time,
but this approach has some limits, and having everything invested in one machine means downtime
when it needs maintenance and limited— often painfully expensive—upgrades. In most cases
it's more affordable, and sometimes the only way possible, to scale horizontally using many
computers to handle large calculations or lots and lots of web traffic. Clustering has become
easier with the advent of Beowulf-style clusters in the 90s, and newer software like Kubernetes,
which seamlessly distributes applications across many computers instead of manually
placing applications on different computers. Even with the software, there are two big problems with
scaling horizontally—especially if you're on a budget. First, each computer costs a bit of money
and requires individual power and networking. For a few computers this isn't a big problem,
but when you start having five or more computers it's hard to keep things tidy and cool. Second,
managing the computers—or "nodes", in cluster parlance—is easy when there are one or two,
but scaled up to five or ten or a hundred? Even doing simple things like rebooting servers are
kicking off a new job requires software to coordinate everything. In 2015, I decided to
set up my first bramble. A bramble is a cluster of Raspberry Pi servers. Why is it called a bramble,
you may ask? Well, because a natural cluster of raspberries that you could eat is called a
bramble. So I started building a bramble using software called Ansible to install a common
software stack across the servers to run Drupal. I set up Linux, Apache, MySQL, and PHP, which is
commonly known as the LAMP stack. Since my bramble ran Drupal, I made up the portmanteau "Dramble",
and thus the Raspberry Pi Dramble was born. The first version of the cluster had six nodes,
and I had a bunch of micro USB cables plugged into a USB power adapter, plus a bunch of Ethernet
cables plugged into an eight port Ethernet switch. When the Raspberry Pi model 3 came out, I trimmed
it [the Dramble] down to five nodes. Then when the Raspberry Pi 0 was introduced, which is the size
of a stick of bubblegum, I bought five of them and made a tiny cluster using USB Wi-Fi adapters—but I
realized quickly the old processor on the zero was extremely underpowered and I gave up on
that cluster. In 2017 I decided to start using Kubernetes to manage Drupal in the LAMP stack,
though I still used Ansible to configure the individual Raspberry Pis and get Kubernetes
installed on them. And today's Dramble, which is made up of four Raspberry Pi Model 4 boards,
uses the official Power over Ethernet or "PoE" board, which allowed me to drop the tangle of
USB power cables, but requires a more expensive PoE switch. The Pi Dramble isn't all serious
though! I've had some fun with it, including making an homage to an old movie I enjoyed.
[Video shows code output on a computer screen while the viewer can hear five short musical
notes playing the communication sequence from the movie Close Encounters of the Third Kind.
The camera pans over to the Raspberry Pi Dramble and shows the same musical sequence again,
this time with the corresponding colored light pattern that was used in the movie.]
Through this whole experience I've documented every aspect of the build, including all
the Ansible playbooks, as an open-source project that's linked from pidramble.com,
and many others have followed these plans and built the Pi Dramble on their own. This is all to
say I've spent a lot of time managing a cluster of Raspberry Pis, and the first question I'm usually
asked is "Why did you choose raspberry PI's for your cluster?". That's a very good question. An
individual Raspberry Pi is not as fast as most modern computers and it has limited RAM. Even the
latest Pi Model 4 has at most 4 gigabytes of RAM, and it's not great for speedy or reliable disk
access either. It's slightly more cost-effective and usually more power efficient to build or buy
a small NUC or "Next Unit of Computing" machine that has more raw CPU, more RAM, a fast SSD,
and more expansion capabilities. But is building some VMs to simulate a cluster on an NUC fun?
I'd say no. Well, not as much fun as building a cluster of Raspberry Pis. And managing bare metal
servers instead of virtual machines also requires more discipline for provisioning, networking, and
orchestration. Those three skills are very helpful in many modern IT jobs. Also, while you may
want to optimize for pure performance, there are times—like when building Kubernetes clusters—where
you want to optimize for CPU core count. If you wanted to build a single computer with 32 CPU
cores, you might consider the AMD Threadripper 3970 X which has 32 cores. Problem is, that
processor cost nearly $2,000 and that's just the processor! The rest of the computer's components
would put you past $3,000. For the Raspberry Pi, each compute board has a four core CPU, and
putting together seven nets you 28 cores—almost the same number of cores, but costs less than
300 dollars. Even with the added cost of a Turing Pi and power supply that's the same number of CPU
cores for a fourth of the cost. Finally, one of the most important lessons I learn when I work
with Arduinos and raspberry PI's is working with resource constraints like limited RAM, slow I/O,
or things like that, highlights the inefficiencies in your code in ways you've never noticed if you
always build things with the latest Core i9 or Threadripper CPUs. If you can't get something and
run well on a Raspberry Pi, consider this: Many smartphones and low-end computers have similar
constraints, and people using these devices would have the same kind of experience. Additionally,
even on fast cloud computing instances, you'll run into network and I/O bottlenecks from time
to time and if your application fails in those situations you could be in for a world of pain.
Getting them to run on a Raspberry Pi can help you identify these problems quickly!
So getting back to the Turing Pi—what makes this better than a cluster of standard Raspberry Pis,
like the Raspberry Pi Dramble? Well, subscribe to my YouTube channel—the button's below! I'll
explore what makes the Turing Pi tick, and how to set up a new cluster in my
next video. If you liked this video and want to see more please consider
subscribing and supporting me on GitHub and Patreon! There are links in the description
below. And if there are any things I missed or questions you have about clustering,
please feel free to ask in the comments below! Until next time, I'm Jeff Geerling.