Re: PostgreSQL with ZFS on Linux

From: Sébastien Lorion <sl(at)thestrangefactory(dot)com>
To: Alban Hertroys <haramrae(at)gmail(dot)com>
Cc: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL with ZFS on Linux
Date: 2014-01-17 06:58:40
Message-ID: CAGa5y0PHd1z3KtitJMhQaUSvoB1U_7oQ8r59JF8NkJHehkQwPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 16, 2014 at 6:34 AM, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:

> On 16 January 2014 12:09, Achilleas Mantzios
> <achill(at)matrix(dot)gatewaynet(dot)com> wrote:
> > http://www.unix-experience.fr/2013/2451/
> >
> > FreeBSD is also a very mature platform for ZFS/postgresql.
>
> More mature than on Linux even, as far as I know. If I had to choose
> an OS to use ZFS with, I'd go with
> either FreeBSD or Solaris. That said, I am biased to FreeBSD anyway;
> the only Linux installation that I
> own is the one in my Android phone, while I own several FreeBSD systems.
>
> > On Thu, Jan 16, 2014 at 4:22 AM, Sébastien Lorion <
> sl(at)thestrangefactory(dot)com>
> > wrote:
> >>
> >> Hello,
> >>
> >> Since ZFS on Linux (http://zfsonlinux.org/) has been declared
> production
> >> ready last March (v0.6.1), I am curious if anyone is using it with
> >> PostgreSQL on production servers (either main or backup) and if so,
> what is
> >> their experience so far ?
> >>
> >> Thank you,
> >>
> >> Sébastien
>
> I do not consider ZFS an ideal file-system for databases. I'm not an
> expert on ZFS, but there are two
> features in ZFS that I think particularly make it less suitable for
> database use.
>
> One reason is that ZFS, as I understand it, is a log-structured
> file-system. That means that changes to files always
> go to the end of the file-system. If that file is a large frequently
> updated database table, records are going to be far
> apart and in fairly random order. That could seriously hurt performance.
>
> Secondly, with ZFS you need to reserve a significant amount of memory
> for the ZIL. That is memory that is
> not available to your database.
>
> Don't take my word for it, but I think the above points are worth
> investigating as is finding some file-system bench-
> marks where ZFS gets compared to, for example, UFS2 (FreeBSD), Ext4fs
> (Linux).
> Of course, the other side of the coin is ZFS's excellent flexibility.
>
> Cheers,
>
> Alban Hertroys
> --
> If you can't see the forest for the trees,
> Cut the trees and you'll see there is no forest.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Those are very good points, but from my own tests and recent TPC benchmarks
I saw on the net (sorry, don't have the links anymore), using SSD makes
them not/less an issue. As you say, ZFS flexibility and ease of maintenance
trumps many cards. Also, something worth pointing out and which may be
counter-intuitive is that using ZFS compression can actually speed things
up: http://citusdata.com/blog/64-zfs-compression

Sébastien

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sébastien Lorion 2014-01-17 07:14:46 Re: PostgreSQL with ZFS on Linux
Previous Message Sébastien Lorion 2014-01-17 06:54:34 Re: PostgreSQL with ZFS on Linux