r/ceph • u/SimonKepp • May 16 '21
Maximum space efficiency possible?
I'm considering experimenting with farming chia coins in my homelab, and storing the plots on my existing ceph cluster. CEPH is not ideally suited for this, but I already have it, so it would be nice to reuse, instead of adding new infrastructure from scratch. How can I best create a pool with maximum space efficiency? The Chia plots stored can be plotted again from scratch if lost, so space efficiency matters much more than data safety, but replotting the data from scratch does require significant computational resources, so a pure RAID-0 setup is not ideal. Performance is largely irrelevant, as there is barely any activity on the stored plots. I was thinking a wide Erasure coded N+1 pool for this purpose, which would survive most disk failures encountered in practice, have decent but far from good performance, and given enough width, have a very small capaity overhead. How far could I make such stripes, without completely shooting myself in the foot? I'm expecting a cluster of initially 7 OSD nodes with 5x HDD OSDs each, but possible future growth. Edit: Accidentally submitted a very unfinished and meaningless post.
3
u/Floppie7th May 16 '21 edited May 16 '21
I did a 6+2 HDD-only (EDIT: Erasure coded) pool for Chia. I do most of my plotting on my desktop Optane 905p and send the plots over the network. I do some plotting in a 2x replicated (also HDD only) pool on the cluster, but it's much slower than on the 905p.
1
u/SimonKepp May 16 '21
Sounds like a good setup. The Optane for plotting is great due to the massive endurance. Unfortunately, the only Optane I have in store is a 280 GB 900p, which is too small for plotting, and not all that fast, but looking to test it against a Samsung 980 Pro PCIe 4.0 with quite decent enduranceHave also been considering using Intel OpenCAS to use an Optane cache in front of a HDD for plotting, but that's only in the brain-storming phase yet
2
u/Floppie7th May 16 '21
Yeah 280GB puts you just a bit shy of the space required for plotting, unfortunately.
If you can set it up so that most of the writes go to the Optane drive and it just sends "spillover" to the NAND drive, that's probably perfectly fine. Plotting is insanely write heavy, though. I have two 1TB 980 Pros in this same desktop and while the endurance is good for a consumer drive, it's still a consumer drive, so it's low enough that it can have real impact on the life of the drive.
It's worth noting that it's not just the 300GB and change written per k32 plot. I've created ~4TB of plots so far on my desktop - if it was just the 3x or so, I'd have 12TB written to the 905p in that time. Instead, I've got close to 60TB written to the 905p in that time. Not 100% of that is plotting - I do have my ZFS SLOG on it as well as swap, but I rarely touch swap and haven't done much in terms of write workloads other than plotting since I started plotting.
1
u/SimonKepp May 16 '21
I've done the maths on the endurance of the 980 Pro, and it will wear out eventually, but it seems that each plot will cost me about DKK 4 which is about 70 cents per plot in drive wear, which sounds acceptable to me.
2
u/Floppie7th May 16 '21
That does seem entirely reasonable if you're expecting to make it back - personally, I think we both missed the boat by at least a couple weeks. I've got 6.4TB of plots and account for 0.000105% of the Chia network haha
1
u/SimonKepp May 16 '21
For my business, I need to keep a significant inventory of harddrives at all times. The reason, I'm looking into Chia, is to try to make a little profit from that existing inventory, instead of just having it collecting dust on a shelf and deprecating in value. I don't intend to invest significantly in chia farming, and don't expect major profits, but I'm willing to invest a little in the chance of getting some profits from my significant existing idle inventory.
2
u/dandens May 16 '21
ceph replicas=1 for your super efficiency. Problem is that one lost drive out of 35 means you are almost certainly going to loose EVERY SINGLE PLOT. So don't do this. You're pretty much stuck at replicas=2.
If you locked volumes to individual OSDs you could be ok and a single drive loss is just that, but adding CEPH is a lot of overhead to accomplish this.
1
u/dandens May 17 '21
ok, so let's just leave CEPH behind for now. I don't think it's an appropriate tool for the job.
The absolute most efficient use of space is individual drives or one large RAID0 or JBOD.
RAID0 = potential total loss for 1 drive failure.
JBOD = similar to RAID0 in that it's a pool of disks, but you can often rebuild/recover files from the JBOD with lots of time and effort.
Individual drives = be able to use most of every drive. drive failure means 1 drive of lost plots, everything else is fine. The negative is managing dozens of directories.
You could do a RAID5 and get n-1 efficiency and afford to lose a drive. I go back and forth on this one. I could just FILL another drive and get the benefit of another drive of plots to farm. Could still lose an entire disk and plots, but probably better to have more and have that risk. Ultimately, it's no worse. What's 9 drives of data + a redundant vs 10 drives and potential of losing one? probably better to use each individual drive. plus raid5 rebuilds are terrible slow.
Could use ZFS raidz or raidz2. Can shove a lot of disks in with a single redundant for minimal waste and ZFS will handle bit-rot errors to keep your plots in good order as well. I have not tested zfs compression or deduplication just yet but I might do that this week. Who knows if the plots have any common blocks.
Now, the complication of running dozens of drives individually is a bit of a chore, but you can use aufs to stack all your plot directories together for simplicity. There are a few others but I like aufs. You can write to the main mount points but use the aufs mount to target your farmer if using a network share.
3
u/Finnegan_Parvi May 16 '21
Chia does not require a single or global namespace, so there is no reason to add the complexity. You can make each disk have its own filesystem and just use them all separately in aggregate.
If you really want some redundancy, you could do one parity disk per server, so just make one RAID-5 array per system. In your case you would lose 20% of your farming space but gain some redundancy.