Let's Build a 28-Core Raspberry Pi Cluster
ikarus.sg
ikarus.sg
Thanks for sharing it here! I'd be happy to answer any questions.
Sorry, but often budget (junk) CPUs are only 10% of the performance of current desktop-class processors.
You can use "openssl speed" to test and compare performance.
When I was experimenting with Intel's Atom netbook chip, it was exactly 10% of a Xeon thread. So it could be used for httpd static content, but not java.
> It'd be an interesting setup to test parallelism and learn how things work.
Long-term, they can be used for DNS, PXE, etc. but most people will not get their money back. If you plan to use docker or k8s, verify they have the right CPU options first.
https://www.openssl.org/docs/man1.1.1/man1/openssl-speed.htm...
It wouldn't be fast, but the battery in it (unless completely dead) even provides some power-outage protection. :)
When I need to access my movie library within a deployment, I just mount the folder as NFS volume. It's working quite well and performances are still decent! Maybe something to consider for Leviathan?
I wanted to ask you if it is worth it implementing something similar in the cloud to learn kubernetes. The hardware is prohibitively expensive on Brazil, so maybe a cluster of t2.micro on AWS running for the total amount of 750 hours could serve the learning purpose for free
Servethehome has a series of articles about the machines, though they're focusing on the slightly higher end ones.
Here's an example: https://kubernetes.io/blog/2019/03/28/running-kubernetes-loc...
If you do intend to self-host some services in the longer term, the cost of running it on the cloud will catch up with the hardware cost in no time at all.
Ebay?
Mellanox cards and related cabling is generally still pretty good (in UK and Australia anyway).
A few years ago I obtained a few 24 port HP Procurve switches (3400cl-24G), with 10GbE (CX4 connectors) on the back.
Those worked pretty well, though turned out to be slightly too noisy for use as desktop switches. ;)
Taking a quick look on US Ebay now, something like this (US$39) might have been workable:
https://www.ebay.com/itm/HP-J9145A-ProCurve-2910al-24G-Ether...
I don't know that seller at all, but ex-enterprise HP Procurve gear should generally be pretty safe. From reputable vendors anyway. :)
For Singapore, I'm not sure. Might have needed to get something from the US shipped over. This one seems like it'd be ~US$80 including shipping, which was probably too much:
https://www.ebay.com/itm/HP-ProCurve-Switch-1800-24G-switch-...
Just be aware that sometimes they change the pins around from the standard pinout, I blew out one of the fans before discovering this. Fan still works, just lost the rpm monitoring :(
I took a naive approach to it before having any clue about electronics, just replacing one of the (3) internal fans with a quieter one of the same voltage. Mostly to see if that would work.
While it functioned, the "fan warning" light was then permanently on (with the replacement fan in).
If I still had the gear and were to do it again, I'd investigate properly and figure out a real solution. :)
> The total damage my wallet sustained from Kraken was S$626.63 or in $449.73 USD, which was virtually all I had left for the month after subtracting expenses and education loan repayments.
I definitely don't have the confidence to spend my entire paycheck on a just-for-fun project, especially considering how many projects I planned on starting but never did. Kudos on the author for being this confident and actually going through with everything.
Nobody got successful by playing it safe.
I don't know what people do with rpi clusters and I'm honestly puzzled why people bother building them. If you get a beefy expensive server, I can understand -- you care about performance. If you get a single rpi to serve files & media in a home LAN it makes sense too -- low footprint, low power and low cost. But I don't know what a rpi cluster excels at. Is it just a toy? Or a learning tool to make computer science & networking concepts concrete and tangible? Or just to get a computer system on a shoestring budget, much cheaper than even a single desktop or laptop?
BTW, computer hardware in Singapore is overpriced. $140 for a switch in Singapore vs $73 for a similarly-capable switch on Amazon. https://www.amazon.com/TP-Link-Ethernet-Unmanaged-Rackmount-...
I could've done this with VMs (and did before.) It is more of a science project to learn kubernetes, etc.
TL;DW - It's fun and you gain the added skills of managing bare metal with physical IO limitations.
It's a different type of desired end result / learning than a purely software approach. :)
That seems like a perfectly good use case to me?
These small emotional things end up making you more interested, and keeps you going in projects. It's the little things! After all this is just for playing around, if you wanted any performance, a single machine would give you more.
I'm putting the air-quotes because I still sincerely hope that it was a joke
Hey if it worked, I'd consider that impressive, not concerning!
>Wiichan it's hosted on a real Wii and it's served throught a shitty Mexican ISP.
There's probably admin tools for that.
I remember people used to run scripts to be sure to get the big gets (6+ last digits identical) but I suppose such methods don't work anymore with captcha and other anti spam measures.
But so far I've not come further than this: how to deal with the host OS?
Like, I don't want to log into N computers and manually run "sudo apt update" etc. I want them to run the same OS but with slightly different configurations.
Network booting via PXE seems to be the best alternative, but not sure how to prepare the images for distribution.
Anyone got any pointers on how this is best done?
edit: I should mention I just found http://cobbler.github.io/ but haven't had time to investigate it. A viable choice?
And in addition, I also run another cluster that has all its code on GitHub and runs this site/wiki: https://www.pidramble.com/
As for how to prepare the images, you need a ramfs image with the root filesystem as a cpio file and a kernel as a vmlinuz file. You then serve these in a basic HTTP file server that your iPXE config points to.
Generating the vmlinuz file is pretty easy given a kernel. The cpio file is trickier. netboot.xyz recommends just grabbing a standard distribution. Otherwise this reduces to the problem of creating your own.
Shameless plug: After a lot of research in this, I came to the conclusion that I'd just have to make it myself, hence Covey (https://github.com/chabad360/covey) a project that's written in Go, and currently in an early alpha stage of development, but it works. More details are in the readme, feel free to email me (its on my GH profile) if you want more details than the readme provides.
EDIT: seems like your looking for something that's primarily for provisioning anyways. Whoops, I seem to have missed the middle paragraph...
EDIT 2: PXE booting may not be the best option for a relatively low ram machine like the Pi (unless you have the storage somewhere else, but that's its own can of worms), even the minimal image required to run k3s would be at least 400mb (I think I'm underestimating) there are ways to deal with that (using a compressed squashfs). But none will beat running directly on the SD card. I'd suggest following the sibling comment, and using overlayfs on top of the main fs to ensure that the image doesn't get tarnished.
In my case I only have 2 different configurations, controller node and worker node. When deploying a new worker node I use a single digit line count shell script to produce the cloud-init files for that node from my template. Basically the only changes between worker nodes are the host name and static IP assigned. I then copy the resulting files to the FAT partition of the boot sdcard.
Someday I might replace this with network booting and something like ansible but for now this is an easy solution and handles 99% of my particular needs.
You could also do something like userdata where you have a script or playbook that runs on first boot and performs additional setup.
I've been meaning to try out PXE booting but am yet to.
You can get a free license for RackN's digital rebar and use their edgelab.digital [1] project to pxe boot and build a four node raspberry pi k3s cluster in a few minutes.
And this one special for k8s: https://www.instagram.com/p/CAqtrRBpNRH/
Been quite keen to build something similar (albeit less nodes) for a little while. I find the homebrew blade style cluster amusing for some reason.
10 seconds is probably not bad for an uncached wordpress page.
Since the goal isn't to achieve maximum performance, the slow CPU & RAM (comparable to a 20th century desktop) might not be an issue. And the lower price would allow more devices so you could test more complex configurations and server management options.
(I have a cluster running Pi 2s, which have 4 cores apiece, but are still too short on RAM)
I agree that it would cost much less, but I would also get much less utility out of it. At this point, the cluster is doing quite a lot, even the site itself is hosted on it.
My point here is that having room for future utility at not much additional cost, would be best.
Finally I can earn my “My other computer is a Beowulf Cluster” bumper sticker from what feels like aeons ago (courtesy of the now-defunct ThinkGeek.com).
Noooo!! They had the best toys.
Unfortunately their shipping to Canada made everything double the price for me...
Longevity of NAND flash is measured in TBW(total bytes written, in terabytes) but they have 4MB or so minimum size for write access, so people easily end up writing effectively gigabytes over weeks or months thinking it's just kilobytes averaged and use up all its life in just few months to years.
You don't need "better quality SD cards", you stop issuing writes. As for why Raspbian isn't built that way so you don't have to be Linux storage experts just to run it correctly, I don't know.
From a forum post in raspberrypi.org[1]:
> My 16 GB SanDisk Extreme Pro 45 MB/s UHS 1 card reports an erase block size of 4 MB.
> My 8 GB Transcend SDHC Class 6 150x card reports an erase block size of 4 MB.
> My 2 GB Transcend SD 150x card reports an erase block size of 8 kB.
.
From another post from StackExchange.com[2]:
> the data cannot be overwritten without being erased first and an erase block is the smallest unit that a NAND flash storage can erase. The erase block size is typically between 128 kB and 2 MB.
.
According to a Micron Technical Note from 2006[3]:
> The NAND Flash device discussed in this technical note is based on a 2Gb asynchronous SLC device and its parameters (unless otherwise noted).
> The NAND Flash array is grouped into a series of blocks, which are the smallest erasable entities in a NAND Flash device.
> A NAND Flash block is 128KB. Erasing a block sets all bits to 1 (and all bytes to FFh). Programming is necessary to change erased bits from 1 to 0. The smallest entity that can be programmed is a byte.
(Note: 2 gigabits = 256 MB)
.
In a more modern TLC 3D NAND chip from 2016[4]:
> Block Size 27,888K bytes
or 27.888MB
---
[0]: https://www.google.com/search?q=microsd+erase+block+size
[1]: https://www.raspberrypi.org/forums/viewtopic.php?t=11258
[2]: https://raspberrypi.stackexchange.com/questions/32884/
[3]: https://www.micron.com/-/media/client/global/documents/produ...
[4]: https://www.micron.com/-/media/client/global/documents/produ...
However I switched to netbooting my Pis, no local storage on the Pi at all.
This does require you to have a netboot server already, of course.
ahem, for 600 dollars I get a fine computer which can host all the kubernets and docker I ever want in a nice formfactor...
I mean, it's cool and all, but effectively utterly useless except for the blinking lights.
It can totally be worth it to do something suboptimal, if it leads to a better learning path :)
It was important that each piece be physically isolated so that we knew the whole path was operational and nothing was short circuiting via something else's network connection. You could have accomplished something similar with VLANs and some routes, but this allowed for easier troubleshooting and to explain to the powers that be how things were guaranteed isolated because they could see it. Plus it looked cool.
Virtualising thousands of CPUs on a single machine is still not trivial.
Never mind simulating real world network issues.
If electricity and cooling is free.
I'd say the most interesting way to approach this at the moment would be to use RasPi 4s and link them via the PCI express bus.
None of this stuff is more than educational, though. I admire this build because it's almost a rite of passage for nerds to build a cluster, but when you're all done and the cool wears off you've basically got a pile of obsolete hardware for which you need to find a home.
HOWEVER, i like to write distributed software that i want "uninformed" users to run. Aka not run on nice, automated k8 deployments - but on dirty, random computers.
My current idea is to run this software on all my personal PCs, but also a couple RaspPis over wifi in random locations.
Slow, poor connectivity machines sounds like a decent and predictably bad user environment.
It's actually usable for live services on RPi 2 and on RPi 4 it beats Intel on float ops./joules at 100% utilization.
And if you use multicast UDP you can make these behave cooperatively to scale horizontally beyond what's possible with a vertical solution at a fraction of the purchase/maintenance cost.
I think we are peaking at 2 Gflops/watt for CPU, so if you need silence (passive cooling) and small size this is as good as it will get, probably ever: http://talk.binarytask.com/task?id=8015986770003767235
I'm building a RPi 4 cluster with these heatsinks.
- Someone out $165 spent on a cancelled pinephone order, no phone and no refund, complete radio silence.
Hopefully you've asked your bank/creditcard to reverse the charge?
I ordered the phone on 5/12, cancelled the order and filed a PayPal "item not received" case on 6/26, escalated the case to a formal PayPal claim on 7/16 (under pressure from PayPal's "close or escalate" automated ultimatum), and as of now it appears the claim finally got refunded on 8/12.
Not a single email response has ever been received from numerous attempts to contact sales@pine64.org throughout this total waste of time and frustration. They ignored requests for updates before I cancelled, seemingly ignored the cancellation, filed an "item shipped" update in the PayPal case on 7/8 despite my cancelling the order on 6/26.
YMMV
Like the author mentions, pre-4 Raspberry Pis gives sad throughput due to the shared bus; Rpi 4 would be much more suitable. There's also Odroid C4, Rockpi 4, Nanopi M4V2.
[0]: https://www.jeffgeerling.com/blog/2020/raspberry-pi-cluster-...
http://forum.pine64.org/forumdisplay.php?fid=91
That being said, I haven't personally used one. (But might get around to it one day out of curiosity.)
Are there laws in Singapore that delineate between consumer and business grade networking equipment based on port numbers or something?
Here in Yankey Land you can pickup a consumer grade 16-port unmanaged gigabit switch for $50 at the local Wally World. The going rate on switch ports is $3-4 per port.
TP-Link makes a $40 unmanaged 16-port gigabit switch and a $80 managed 16-port gigabit switch.
He's created a False dilemma/dichotomy by pretending that other options don't exist. This is like saying "I'd like a Toyota automobile larger than the Yaris but I can't afford the Lexus LS".
Singapore is a very small (~250 sq mile) country, so it would take less than 30 minutes to drive across.
It's very wealthy.
It has, almost dead center in the middle, an electronics mall called Sim Lim Tower that's like 10-20 stories tall.
They most certainly have options.
I was just pointing out characteristics that would lend themselves toward sourcing a network switch (e.g. accessible, wealthy, giant freaking electronics malls).
Maybe the traffic will provide an interesting exercise in optimisation?
eg move from wordpress to static content or something, maybe add some CDN pieces, then whatever else turns out to be needed?
Southampton had instructions here, I believe it was: http://www.southampton.ac.uk/~sjc/raspberrypi/
(Maybe still useful if you want to do without docker?)
If you don't need 99.9999 availability of your cluster and are only interested in firing up the cluster from time to time then those same 600$ can buy you a few years of cluster time
8 of those instances is equivalent to an 8 core (16 thread) chip with 64GB of memory. Using, e.g., Supermicro AMD EPYC 3251 + parts, you could build an entire server for less than 1/2 that price. You could have twice the compute for the same price the first year. Servers easily last 3 years minimum, so Hetzner has a 6x markup at the low end.
Admittedly, building your own server doesn't include transit, but transit is cheap. Assuming you have a fast home connection (a big if for many people), the hard part is access to static IP addresses. There are dedicated services that lease IPs over a VPN tunnel, or you can setup your own VPN into, e.g., Hetzner or Vultr using a handful of the cheapest instances. (Not sure about Hetzner, but Vultr let's you lease and attach 2 additional IPs to the same instance for $2/month/IPv4 address.)
Now, the above setup is probably far too much trouble for most people, and it has many downsides[1]. But the point is that if we're just talking about CPU time, not even Hetzner or some other cheap VPS provider can come close to the cost of running your own equipment.
[1] Power and cooling are two downsides, but the 3251 has a TDP of 50W. Granted, it doesn't have the highest clock speeds, but there's a reason cloud providers don't normally advertise Ghz. Anyhow, rather than build 2x 3251's you could build a single 16 core rig using a higher-clocked and newer EPYC or Xeon for about the same money (definitely at or under 2200€ all-in).
Your choice of comparisons suggest you completely missed the whole point. If the author wanted a desktop I'm sure he would buy one for 600$ instead of spending that money to put together an underperforming cluster that's entirely unusable as a desktop.
If instead you are interested in gaining experience managing a cluster that runs distributed systems then yes you would do something like putting together a raspberry pi cluster.
Yet, if you seek to have the same experience (or arguably far better) without spendig a hefty sum as capex and having access to more computational resources for a negligible opex then cloud providers such as Hetzner are clearly a far better option.
https://www.servethehome.com/introducing-project-tinyminimic...
All in that was around 450 eur over a year ago, all bought in EU.
All three running linux with no load consume around 30W.
I think the author mentioned only spending $449.73USD (i can't verify because the sites down), which seems cheaper than what you mentioned.
I'm also struggling to find exactly what you're talking about. I'm seeing 9020's, but no M, do they actively sell it still?
I'm not nitpicking your comment - i too am interested in throwing a couple Pis in a closet for some distributed systems projects i'm working on. I expect them to be slow, low bandwidth, but simple over wifi/etc. I don't want to pay more than i need for closet computers, though, so i'm interested. :)
For something cheaper, I can find in my country lenovo tiny m72, for something like 40 eur. No SSD/Ram, you can configure it as you wish (and still will be cheaper then RPi, even after adding like 2GB of ddr3 - it's something like 4EUR per stick, there are 2 slots in each machine).
That is with Intel Core i3-2120T, so would expect much more performance then even RPi4
Edit: I see now that the same seller has them for ~72eur with 120GB of ssd and 4GB of ram if someone wants something ready to use.
Where does it become a better idea to just rent a few instances in Azure/EC2/Google Cloud?