Re: ZFS vs. UFS
Greg Smith <greg <at> 2ndQuadrant.com>
2012-07-27 05:24:42 GMT
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
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
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
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 <at> 2ndQuadrant.com
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com