It would seem like with 3 devices, it's possible to configure a ZFS pool with either mirror or raidz2 mode.

What's the difference in performance and reliability?

(In regards to reliability, I'm specifically interested in the topic of partial data loss.)

  • So a 3 way mirror would keep 3 copies of any data, while a 3 disk raidz2 would keep 1 write and 2 parity calculations of each data? One would imagine the mirror would be fast relative to the parity calculations, especially in a failure scenario requiring a rebuild. – Yolo Perdiem Oct 9 '13 at 20:44
  • @evilensky Actually, RAIDZ & RAIDZ2 don't suffer from the same write penalty as traditional RAID5 & RAID6, and the performance is more comparable to the performance of a ZFS mirror. This is totally different then calculating RAID5 & RAID6 write penalties. See [Is calculating IOPS for ZFS RAIDZ different then calculating IOPS for RAID5 & RAID6?].(serverfault.com/a/531323/36178) – Stefan Lasiewski Oct 9 '13 at 20:57
  • @StefanLasiewski I'm not sure I made a comparison to RAID5/6 in my comment. Are you suggesting that there is less overhead in calculating parity or data-from-parity than making 2 additional copies? – Yolo Perdiem Oct 9 '13 at 21:09

RAIDZ2 should have a minimum of 4 disks. At any rate RaidZ is a lot slower than mirroring (and RAID6). Mirroring and RAIDZ both use ZFS checksumming for data integrity.

See ZFS: Mirror vs. RAID-Z

  • 2
    Not what it says in the manual page. mdoc.su/f92/zpool A raidz group with N disks of size X with P parity disks can hold approximately (N-P)*X bytes and can withstand P device(s) failing before data integrity is compromised. The minimum number of devices in a raidz group is one more than the number of parity disks. – cnst Oct 9 '13 at 20:47
  • @cnst It suggests the same answer for your 3-disk mirror as your 1 data + 2 parity = N-2 failures. – Yolo Perdiem Oct 9 '13 at 21:12
  • 1
    yes and directly under that in the best practices guide that it comes from it says "Start a double-parity RAIDZ (raidz2) configuration at 6 disks (4+2)" – JamesRyan Oct 9 '13 at 22:54
  • Irregardless of whether it is possible you would never choose raidz2 for as few disks as 3 over a mirror because, for the reasons previously mentioned, it is inferior. – JamesRyan Oct 9 '13 at 22:58
  • @JamesRyan, no, it doesn't say that in mdoc.su/FreeBSD-9.2/zpool.8; directly under that, it says that the recommended minimum is 3 and maximum is 9. – cnst Oct 9 '13 at 23:19

Technically you can do mirror, raidz, or raidz2, not just mirror or raidz2.

There is absolutely no reason to use raidz2 on a 3-disk set. You will get effectively nearly an equivalent amount of usable space out of those 3 disks as if you had mirrored them, but with significant additional complexity for I/O and a lower read speed. ZFS mirrors can round-robin read access across all spindles within the vdev, whilst raidz cannot.

So really the only question here is raidz (raidz1) or mirror. And then you're back into the more familiar world of data resiliency versus capacity. A 3-way mirror is significantly more resilient than a 3-disk raidz vdev, but a 3-disk raidz vdev has about twice the usable space as the 3-way mirror.

  • Oh, and with the 3-way mirror, you could also remove a disk later if you decided 3-way redundancy was too expensive. You cannot with a raidz or raidz2 vdev (you cannot alter the number of disks in a raidzX vdev once built). – Nex7 Oct 11 '13 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.