Re: New server disk setup?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Adam Rich <adam(dot)r(at)sbcglobal(dot)net>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: New server disk setup?
Date: 2009-09-04 04:00:29
Message-ID: dcc563d10909032100t66e1dfc0v7424614e09ffdae9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 3, 2009 at 2:08 PM, Adam Rich<adam(dot)r(at)sbcglobal(dot)net> wrote:
>
> Hello,
> I'm building a new server on RHEL 5.3 and was wondering if there was an
> optimized build guide published somewhere with guidelines on disk
> partitioning, filesystems, etc?  For example, do you recommend putting the
> data on an ext2 partition mounted noatime, and the logs on ext3? Or should I
> just use XFS for the whole thing?

I generally create 2 or 3 RAID sets. If two sets, the first set has 2
drive RAID-1 for OS and pg_xlog and one RAID-10 for as many drives as
I can stuff into a machine, minus one or two for spares. If three
sets, then a RAID-1 for the OS, a RAID-1 for pg_xlog and the rest
(i.e. data/everythingbutpg_xlog in a RAID-10 with spare(s). After
that I'd add drives to pg_xlog or or the data partition as needed
based on testing.

Suppose you have a near infinite number of drives to toss at a
problem, with a perfect computer with fantastic bandwidth. Most
likely you'll keep adding drives to the RAID-10 data partition, until
it got so big it started outrunning pg_xlog ON RAID-1. The next step
is to make pg_xlog faster, usually going to RAID-10. Assuming you can
write to as many drives as you want as fast as you want, this need
will arise somewhere fairly up into the numbers in the /data
partition.

Getting pg_xlog, which is mostly sequential, onto its own set of
drives is a great way to speed up most pg installs, even with only a
few drives. As few as 8 drives, preferably with a spare, can be setup
in a three RAID set with 2, 2, and 4 drives in RAID-1, RAID-1 and
RAID-10 respectively can run pretty fast. I usually setup OS on ext3,
pg_xlog on ext2, and xfs or RAID-3 on the bigger RAID-10 partition.

You can choose whether or not to use software RAID alone, SW RAID on a
battery backed RAID controller in JBOD mode, mixed software and
hardware for RAID-10 (OS does the striping, HW builds the mirrors) or
full hardware RAID controller. You really need to test on your load
to know which is faster for you, but there's no obvious answer. But
battery backed cache on your drives buys you a lot, whether or not
it's the hardware doing it all or the OS using it as a JBOD.
Definitely test both of those.

As you increase the size, note that Centos / RHEL 5 have an 8TB file
system limit. And you can't boot from anything > 2TB as a drive.

As for setting up the physical drives in the partition, it's important
to create physically, not just logically, separate RAID sets.

> Are there any other brand-new server choices to consider now?

I think BSD and RHEL/Centos and debian are the only real choices for servers.

> It would be great if one could view the developer-recommended configuration
> for a particular operating system on the postgresql.org website.  I found a
> few guides on the wiki, but they are either 3+ years old, or they don't
> focus on server-setup as a whole.

Problem it's always a moving target. :) So these discussions show up
again every few months, and they server a good purpose. You might get
better / different answers from -perform or -admin on a second try.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Juan Backson 2009-09-04 04:36:37 N + 1 replication
Previous Message Gordon Shannon 2009-09-04 03:43:38 Got could not truncate directory "pg_multixact/offsets": apparent wraparound