This is an old but still-relevant question.
Linux Software RAID / mdadm RAID 5
A "plain" MD RAID5 of HDDs or consumer SSDs will be slow. To get good performance, one has to use powerloss-protected writeback cache SSDs or use a RAID journal device (itself on a fast, powerloss-protected SSD).
LVM writeback cache on a 512 MB ram disk
Writeback on a RAM DISK is going to be a bad idea: in case of powerloss, you will completely corrupt your volumes. It is way better (still dangerous) to simply disable barriers / sync writes putting the kernel in "write through" mode (see here the description about write_cache
). A power loss will cause data loss, but hopefully not the cataclysm that losing the entire writeback device would be.
Host backed by UPS to prevent data loss like the BBU on hw raid
Powerloss will happens. An UPS is a first line of defense, but not let it be the only one.
What you can do:
- use
lvmcache
to use a fast, enterprise-grade, powerloss-protected SSD to cache your slow pool. If using a single SSD select LVM writethrough
, while if using an SSD RAID1 pair you can select LVM writeback
(be sure to understand what you are doing, though). Note: you probably want to use LVM cache
rather than LVM writecache
(the latter is for a more specific use case);
- use ZFS with L2ARC and SLOG devices. This is my recommended setup: you can use read-centric, fast but inexpensive devices for L2ARC, and a more pricey, powerloss protected SSD for SLOG (a mirrored pair of such SLOG devices is a good idea for maximum reliability).
For what it is worth, I run many systems with the above ZFS setup and I am very happy about their performance, reliability and data-correctness guarantees.