Hey everyone!
So, my brain has cooked up a thing, which I want to share with you, in the hopes, that we could brainstorm over it and work out, if this is actually feasible.
I currently am obsessed with building the most power efficient Server for my needs. I have a zpool containing two mirrored spinning disks, which currently are running 24/7. Because this is my Home Server, the zpool is mostly idle, as there are not many services, that frequently use the zpool.
Now to my idea.
I want the hard drives to stay non-rotating most of the time, to conserve power and to minimize noise. The drives should only spin up to “sync” the latest changes for example every hour and then spin down again. I know of the disadvantages spinning HDDs up and down all the time.
I was thinking of the following steps:
- Disable synchronous writes in the entire pool with sync=disable
- Raise the vfs.zfs.txg.timeout to e.g. 3600
- Attach a mirrored special vdev located on an SSD to the zpool to hold all the metadata, speed up the access times of the pool and prevent spinning up the drives for every metadata related operation
- Attach a cache vdev to the zpool located on an SSD to read the most used data from flash, again, without the need to spin up the drives
I am aware, that disabling synchronous writes raises some serious risks of data loss on an unorderly shutdown. But I basically never write any data to the zpool, that is not replacable and I am willing to take that risk.
My understanding is, that all the data, that is about to be written to the zpool and that is being accumulated over the period of 3600 seconds, is cached in RAM and only written to disk, when those 3600 seconds expire or when the size of the RAM-cache is exeeded.
Is this true? Would utilizing a mirrored log vdev help with catching those writes?
What do you think of my idea? Would this actually work or am I getting it totally wrong?
I would love to hear your input on this and discuss this topic further, because this really fascinates me.
I am looking forward to any input that any of you can provide.
Cheers!