Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 May 2012 10:46:32 +0200
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Chris <skvortsov42@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: ZFS 4K drive overhead
Message-ID:  <4FA63A68.3050607@quip.cz>
In-Reply-To: <CA%2BZnuqw8YpOD3fV6%2BeoGLqH6J%2Bpmafaw=c_iaMUNRK7TUe39%2Bw@mail.gmail.com>
References:  <CA%2BZnuqw8YpOD3fV6%2BeoGLqH6J%2Bpmafaw=c_iaMUNRK7TUe39%2Bw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Chris wrote:
> Hi all,
>
> I'm planning on making a raidz2 with 6 2 TB drives - all 4K sectors,
> all reporting as 512 bytes. I've been reading some disturbing things
> about ZFS when used on 4K drives. In this discussion
> (http://mail.opensolaris.org/pipermail/zfs-discuss/2011-October/049959.html),
> Jim Klimov pointed out that when ZFS is used with ashift=12, the
> metadata overhead for a filesystem with a lot of small files can reach
> 100% (http://mail.opensolaris.org/pipermail/zfs-discuss/2011-October/049960.html)!
> That seems pretty bad to me. My questions are:
>
> Does anyone on this list have experience using ZFS on 4K drives with
> ashift=12? Is the overhead per file, such that having a relatively
> large average filesize, say, 19 MB, would render it insignificant? Or
> would the overhead be large regardless?

Average size of 19MB is much more larger than 4k (metadata), the 
overhead will be not so high as with really small files (files with size 
of few kB).

> What is the speed penalty for using ashift=9 on the array? Is the
> safety of the data on the array an issue  (due to how ZFS can't write
> to a 512 byte sector but it's coded with the assumption that it can
> thus making it no longer strictly copy-on-write)? Does anyone have any
> experience with ashift=9 arrays on 4K drives?

Even if the overhead will be larger, the speed penalty is much higher. 
You should read about it in some post on this blog:

http://blog.des.no/search/label/freebsd

There are various articles with banchmarks of 4k sectors drives and some 
of them are almost useless with unaligned writes. So I strongly 
recommend you to use 4k (ashift=12).

Use ashift=9 only if performance doesn't metter and you are concerned 
only on available space.

Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FA63A68.3050607>