ZFS: How to enable cache and logs.

Freddie Cash fjwcash at gmail.com
Thu May 12 03:56:00 UTC 2011


On Wed, May 11, 2011 at 8:36 PM, Jeremy Chadwick
<freebsd at jdc.parodius.com> wrote:
> On Wed, May 11, 2011 at 09:51:58PM -0500, Bob Friesenhahn wrote:
>> On Thu, 12 May 2011, Danny Carroll wrote:
>> >
>> >Replying to myself in order to summarise the recommendations (when using
>> >v28):
>> >- Don't use SSD for the Log device.  Write speed tends to be a problem.
>>
>> DO use SSD for the log device.  The log device is only used for
>> synchronous writes.  Except for certain usages (E.g. database and
>> NFS server) most writes will be asynchronous and never be written to
>> the log.  Huge synchronous writes will also bypass the SSD log
>> device. The log device is for reducing latency on small synchronous
>> writes.
>
> Bob, please correct me if I'm wrong, but as I understand it a log device
> (ZIL) effectively limits the overall write speed of the pool itself.

Nope.  Using a separate log device removes sync writes from the I/O
path of the rest of the pool, thus increasing the total write
throughput for the pool.

> Danny might also find this URL useful:
>
> http://constantin.glez.de/blog/2011/02/frequently-asked-questions-about-flash-memory-ssds-and-zfs

Read the linked articles.  For example:
http://constantin.glez.de/blog/2010/07/solaris-zfs-synchronous-writes-and-zil-explained

Most sync writes go to the ZIL.  If the ZIL is part of the pool, then
the pool has to issue two separate writes (once to the ZIL, then later
to the pool as part of the normal async txg).  If the ZIL is a
separate device, then there's no write contention with the rest of the
pool.

Not every sync write goes to the ZIL.  Only writes under a certain
size (64 KB or something like that).

Every OpenSolaris, Oracle Solaris, Nexenta admin will recommend
getting an enterprise-grade, write-optimised, SLC-based SSD
(preferably with a supercap) for use as the SLOG device.  Especially
if you're using ZFS for anything database-related, or serving files
over NFS, everyone says the same:  get an SSD for SLOG usage.

Why would it be any different for ZFS on FreeBSD?

There are plenty of benchmarks online and in the zfs-discuss mailing
list that shows the benefits to using an SSD-based SLOG.

-- 
Freddie Cash
fjwcash at gmail.com


More information about the freebsd-fs mailing list