Jun 5, 2010

A Closer Look at ZFS, Vdevs and Performance

A Closer Look at ZFS, Vdevs and Performance: "

When looking at the mails and comments I get about my ZFS optimization

and my RAID-Greed posts, the same type of questions tend to pop up over and over again. Here's an example from a reader email:

'I was reading about ZFS on your blog and you mention that if I do a 6 drive array for example, and a single RAID-Z the speed of the slowest drive is the maximum I will be able to achieve, now I thought that ZFS would be better in terms of speed. Please let me know if there is a newer ZFS version that improved this or if it does not apply anymore.'

This is just an example, but the basic theme is the same for much for the reactions I see: Many people think that RAID-Z will give them always good performance and are surprised that it doesn't, thinking it's a software or a ZFS issue.

In reality, it's just pure logic and physics, and to understand that we should look a little closer at what vdevs are in ZFS and how they work.

What is a Vdev?

Another reader pointed out that I should define vdevs as short and simple as possible, so here we go:

A ZFS vdev (aka 'virtual device') is either:

  • a single disk, or
  • two or more disks that are mirrored, or
  • a group of disks that are organized using RAID-Z.

There are also special kinds of vdevs like hot-spares, ZIL or cache devices, etc. but we'll leave that to another post. Look up the full definition in the zpool (1M) man page.

So there you have it: A disk, a mirror or a RAID-Z group.

A ZFS pool is always a stripe of one or more vdevs that supplies blocks for your ZFS file systems to store data in.