pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndQuadrant.com>
To: Laszlo Nagy <gandalf@shopzeus.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: ZFS vs. UFS
Date: Fri, 27 Jul 2012 01:24:42 -0400
Message-ID: <5012261A.8040007@2ndQuadrant.com> (raw)
In-Reply-To: <500E9A3B.3070609@shopzeus.com>
References: <500E9A3B.3070609@shopzeus.com>

On 07/24/2012 08:51 AM, Laszlo Nagy wrote:
> Under FreeBSD 9, what filesystem should I use for PostgreSQL? (Dell 
> PowerEdge 2900, 24G mem, 10x2T SATA2 disk, Intel RAID controller.)

When Intel RAID controller is that?  All of the ones on the motherboard 
are pretty much useless if that's what you have.  Those are slower than 
software RAID and it's going to add driver issues you could otherwise 
avoid.  Better to connect the drives to the non-RAID ports or configure 
the controller in JBOD mode first.

Using one of the better RAID controllers, one of Dell's good PERC models 
for example, is one of the biggest hardware upgrades you could make to 
this server.  If your database is mostly read traffic, it won't matter 
very much.  Write-heavy loads really benefit from a good RAID 
controller's write cache.

>     * ZFS is journaled, and it is more independent of the hardware. So
>       if the computer goes wrong, I can move the zfs array to a
>       different server.
>     * UFS is not journaled. Also I have to rely on the RAID card to
>       build the RAID array. If there is a hw problem with it, then I
>       won't be able to recover the data easily.
>

You should be able to get UFS working with a software mirror and 
journaling using gstripe/gmirror or vinum.  It doesn't matter that much 
for PostgreSQL though.  The data writes are journaled by the database, 
and it tries to sync data to disk after updating metadata too.  There 
are plenty of PostgreSQL installs on FreeBSD/UFS that work fine.

ZFS needs more RAM and has higher CPU overhead than UFS does.  It's a 
heavier filesystem all around than UFS is.  Your server is fast enough 
that you should be able to afford it though, and the feature set is 
nice.  In addition to the RAID setup being simple to handle, having 
checksums on your data is a good safety feature for PostgreSQL.

ZFS will heavily use server RAM for caching by default, much more so 
than UFS.  Make sure you check into that, and leave enough RAM for the 
database to run too.  (Doing *some* caching that way is good for 
Postgres; you just don't want *all* the memory to be used for that)

Moving disks to another server is a very low probability fix for a 
broken system.  The disks are a likely place for the actual failure to 
happen at in the first place.  I like to think more in terms of "how can 
I create a real-time replica of this data?" to protect databases, and 
the standby server for that doesn't need to be an expensive system.  
That said, there is no reason to set things up so that they only work 
with that Intel RAID controller, given that it's not a very good piece 
of hardware anyway.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com

view thread (12+ messages)  latest in thread

Message-ID: <5012261A.8040007@2ndQuadrant.com>
Permalink:  ../5012261A.8040007@2ndQuadrant.com/
Also on:    postgresql.org/message-id/5012261A.8040007@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: greg@2ndQuadrant.com, gandalf@shopzeus.com
  Subject: Re: ZFS vs. UFS
  In-Reply-To: <5012261A.8040007@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox