Ask HN: How would you build a budget CPU compute cluster in 2023?
So lately I've been dabbling in a lot of stuff that requires a lot of CPU compute, 0 GPU and can be basically linearly scaled across threads and nodes in a cluster.
Now using only my own box is proving to be a bottleneck so I've been thinking of either using AWS spot instances or building my own mini-cluster (2-3 machines + switch) at home. Does it make sense to go cloud (even spot) when I would aim at high utilization?
As for the potential node spec:
- Ryzen 4500/5500 (seems best perf/$)
- Some mATX AM4 mobo with integrated GPU
- 2x8GB RAM
- mATX case, the smaller the better. ITX seems pricier.
All the box does is basically run the k8s pod(s).
WDYT?
70 comments
[ 412 ms ] story [ 1936 ms ] threadOf course "cheap" can cost too much: if you need reliability and want it to run first time after assembly, then it might pay to spend more.
For example, I might suggest buying used Lenovo Tiny M75q's on eBay. The Ryzen 3400GE is significantly slower than your Ryzen 4500, but also lower TDP and very cheap procurement cost. Also fits your "smaller the better" wish. No ECC, though.
Once you have your intended compute lifecycle figured out you can compute the cloud cost and hardware cost and compare. Given you’re mentioning k8s I’m assuming this might be a continuous load in which case you’d amortize your hardware capital costs much faster.
But if you can break that up and batch process it over 24h, and you don't have a need to scale up and down, a VPS from OVH is going to give you almost an order of magnitude lower cost than Azure, AWS, and GCP will for a box running 24h/day. What $5/mo gets you on OVH will run you close to $50/mo running 24/7 in a public cloud.
You can buy a couple of 16 to 22 core Xeons on AliExpress and a dual CPU motherboard for them. Plenty of reviews on YouTube.
I'd recommend something like a GT 700-series card for this purpose. I've got one I stick into my server when I need it to have a screen. Costs like 50 bucks.
This used hardware can be easily be 2-4 times cheaper than building using modern CPUs, but power usage is also much higher.
beefy dedicated servers for 50/100 eur per month
you can use it for a few months and return it any time monthly contract)
Hybrid cloud ?
"combines and unifies public cloud, private cloud and on-premises infrastructure to create a single, flexible, cost-optimal IT infrastructure."
Hetzner has a dedicated cheap server: ( monthly pricing )
https://www.hetzner.com/de/dedicated-rootserver/matrix-ax
- AMD Ryzen™ 5 3600 ( € 37.30 + VAT) / month
- AMD Ryzen™ 7 7700 ( € 59.00 + VAT ) / month + setup
- AMD Ryzen™ 9 5950X ( € 103.30 + VAT ) / month
- AMD EPYC™ 7502P ( € 119.80 + VAT ) / month + setup
Power and heat. Will you have enough power for the nodes? What is the power trade-off if you get low-end chips vs higher-end chips? Have a look at the Ryzen page on wikipedia to get a feel for power use of each chip. How will you understand how much cooling you need? (more cooling takes more power)
RAM. How much does accuracy matter? Should you use ECC RAM? You can get UDIMMs to work in Ryzen kit, but not with the chips with integrated graphics card (i.e. avoid APU chips if you want ECC). Get Asrock or Asus AM4 motherboards, then get RAM like this - Samsung M393A4K40DB3-CWE. If you go cloud, you may find the hardware has ECC.
IO. Once the grid-of-nodes is in place will you be moving data to functions, or functions to data? How much data are you moving over the network per-job? Might there be IO bottlenecks when you scale up? How detailed a model of IO can you build before you settle on hardware?
I find that once you have a bunch of equipment piled up it makes a huge hard to manage mess, and that happens a lot faster than you'd expect. Before finally getting a rack I ended up with with a bunch of hardware caked in dust because it was all lying in such a precarious way that I was afraid to touch anything in there.
Build your own boxes.
You can use Kerrighed or OpenSSI for the software side.
Why is this so cheap? I always did software so my hardware knowledge is pretty basic but still this kind of chip can really offer a lot in terms of performance even now?
Perf/$ is only decent because they’re dirt cheap on the used market as datacenters are dumping them
Still, considering it is like 4-5x times cheaper and uses a mobo with two CPUs (which saves on cost cause you don't need to build 2 boxes) this might be a good idea that I'll strongly look into. Thanks!
If you’re on a shoestring budget, don’t mind hunting down and testing used parts, and power and noise aren’t an issue then those old server parts are great fun though.
> - Ryzen 4500/5500 (seems best perf/$)
Price/performance is great for the CPU, but you have to spend hundreds of dollars on the motherboard, RAM, power supply, and case for each one.
You need to look at the overall system cost. If you’re building new, it could be cheaper overall to put 12-core or 16-core CPUs into a smaller number of machines than it would be to put a lot of $100 budget CPUs into many machines.
Unless your goal is to build a cluster for the sake of building a cluster, you might have a better price/performance ratio by building a single 16-core 7950X box than you would with three separate Ryzen 4500 or 5500 machines.
Even with perfect scaling, you would need at least 4 separate Ryzen 5500 machines to have a chance at beating a single 7950X for CPU-bound tasks. The 7950X CPU alone is barely more than 4X the cost of a Ryzen 5500, but you only need to buy one motherboard, one power supply, and so on.
According to Geekbench [0] you only need 3. [0] https://browser.geekbench.com/processor-benchmarks/
For my home server, I pick the smallest case that can fit a desktop CPU, so just a bit bigger than Intel Nuc. Those have laptop CPU's, you are overpaying. I am willing to pay extra for it to be small.
The two best contenders for me are Asrock DeskMini barebones system (picoITX) and IN WIN Chopin case - you gave to buy an ITX motherboard.
I use Chopin with an Intel CPU, they work for my usecase.
Also some motherboars can boot a ryzen without any GPU at all. Asrock usually will. If you are willing to deal with a totally headless system, go for it.
it sound like minipcs can be an excellent solution for you.
For how long will you be using this? AWS may be preferable in the short term while local hardware may be cheaper in the long term/a lot of cpu hours.
there is also the question of your application performance on different cpus. there are older servers available for very cheap prices but is it worth it to buy a 12/20core xeon cpu that consumers 200-300W if its performance is similar to a 5900 at 150W ?
The reason I have two is I started with a 3400g (4c/8t) due to supply limitations, then upgraded to a 4750g (8c/16t) when it became feasible. Over time I upgraded memory and storage, so eventually I had everything but the case for a second “half-power” machine.
Having multiple medium-power machines can be useful for rolling upgrades (and for learning purposes), but otherwise it’s very uneconomical.
If your goal is to maximize cores/$ then a single beefy machine will do best.
You make such a great point that I’m going to rename it: paradox
Thank you, Lithium!
I use 4 Lenovo M910x's as a kubernetes cluster and home lab. Have them all connected with a netgear switch. The whole setup costs about the same as a single new quality work station. Each has: i7 8700 (6c - 12t), 32gb memory, 1TB SSDs, <1L case, they're practically silent. easy to find parts, they even use lenovo laptop chargers. if one dies, I can easily purchase + replace in a few days.
You can even go cheaper if you don't need the absolute fastest cpus. Some of these older tiny computers can be purchased for around 100 bucks if you look for them. It has worked like a charm for me. Not sure how much horsepower you really need, but this is a cheap way to build a home cluster. I think they hover around using 40w most the time, so power isn't really too big of a cost either.
Just asking out of curiosity: Why not a Ryzen 16-Core CPU + 128GB RAM and then VMs / containers everywhere? To me that seems much less hassle than having to pet four machines, as I am way too lazy to write automation stuff for myself. Also such a setup setup needs less space and probably less power.
It will be harder to simulate failure there to see how the system behaves in such a case. You could just remove ethernet cable or remove a power cable, and see how it reacts.
How do you tell which of these available boxes has Intel AMT (or its AMD equivalent) fully enabled?
No listing reports this, and sellers seem to not be able to answer the question either.
How did you figure that out? Or are you managing without remote management? If so, how?
They even have auctions: https://www.hetzner.com/sb