similar questions have been asked multiple times ...
- How to use an SSD for caching, so my hard disks can spin down?
- Caching write changes on SSD to avoid HDD spin-up? ZFS, but (probably) not L2ARC
- https://superuser.com/questions/664400/ssd-cache-to-minimize-hdd-spin-up-time
- Unionfs vs Aufs vs Overlayfs vs mhddfs, which one do I use
- Merge changes to upper filesystem to lower filesystem in Linux Overlay (OverlayFS) mount
... but none of them has a answer. As most of those questions are old (2012-2015), I'm trying again.
I have a 6 GB ZFS pool that is mostly idle. Still it's too busy to get the disks to spin down, as there are always some small writes on the server. By powering the disks down for long periods, I want to keep wasted energy at a minimum. I want to emphasize that performance is not my concern (the pool is fast enough), but rather energy consumption.
My idea is to add a 1 TB SSD to the system as "persistent cache" (not sure if that's the right word). More specifically, the system should do the following:
- Reads are initially answered from the pool, but the file (or blocks) in question should be stored on the SSD. Subsequent reads should be answered from the copy on the SSD.
- Writes are stored on the SSD. Rarely (like every three days), new files should be written to the pool.
Are there solutions to this problem? From my research, I found that
- AUFS might be able to solve my problem but it's not included in the kernel. I don't know if there is a userspace driver and how good it is.
- Instead, OverlayFS was pushed by the Linux community. To me, it seems that my use case is explicitly unsupported (as upper folders cannot be merged into lower folders, for whatever reason). If I understand correctly, OverlayFS actually sees that as a feature instead of a shortcoming - that would imply uselessness for my use case.
- bcache: bcache in writeback mode with high writeback time does appear promising. However, the documentation states that "it will let sequentials reads/writes on HDD/Raid devices by default". Is there a way to turn this behavior off? Also I don't want writing back to happen too early and that appears to be problematic.
- MergerFS: I don't know if it can do what I need.
Are there any tools/solutions/suggestions that I didn't see yet?