3

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.)

cnst
  • 12,948
  • 7
  • 51
  • 75
  • 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 09 '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?].(http://serverfault.com/a/531323/36178) – Stefan Lasiewski Oct 09 '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 09 '13 at 21:09

2 Answers2

2

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

JamesRyan
  • 8,138
  • 2
  • 24
  • 36
  • 2
    Not what it says in the manual page. http://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 09 '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 09 '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 09 '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 09 '13 at 22:58
  • @JamesRyan, no, it doesn't say that in http://mdoc.su/FreeBSD-9.2/zpool.8; directly under that, it says that the recommended minimum is 3 and maximum is 9. – cnst Oct 09 '13 at 23:19
  • @JamesRyan While I agree with the main point of your answer, I don't see how any raidz is slower than RAID6, esp. with regards to writes. – 84104 Oct 10 '13 at 03:23
  • @84104 Being copy on write there are still multiple operations on write so it is of comparible performance. However reading is vastly slower, giving single drive performance vs raid5/6 ability to use multiple drive simultaneously. Mirroring is faster than either. https://blogs.oracle.com/relling/entry/zfs_raid_recommendations_space_performance – JamesRyan Oct 10 '13 at 15:05
1

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.

Nex7
  • 1,925
  • 11
  • 14
  • 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