UnRAID Cache Pool Write Amplication
Beware of using the combination of a multi-disk cache pool in UnRAID and encryption. It results in a significant write amplication.
To describe the scenario, let’s talk about a Linux server that writes one log entry to disk. Appending a log entry is actually a lot more involved, because of the filesystem. For safety, the filesystem will write a “journal” entry, which lists its intention to update the log file, make sure that’s written to disk first, then write the update to the file. In addition, there’s metadata that needs to change, identifying that the file is longer, and that the new data block(s) are being used.
With a VM, its hard disks are actually a file. That file resides on another filesystem, so the original metadata write, journal write, and actual data write will all cause more physical writes.
Back to UnRAID, if you have a single, unencrypted cache disk, in my experience, this hovers at around 10kB/sec.
However, if you encrypt your disk, changing one byte on disk actually reads and re-encrypts the whole block, which amplifies the writes to around 100-200kB/sec.
Adding a second (or more) cache drives doubles this, as every block written needs to be sent to two disks in the pool.
This means that running a few VMs, on an encrypted cache pool could mean you are constantly writing 2-5MB/sec to your cache pool, which will whittle away the life of your disks.