pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Kevin Kempter <kevin@kevinkempterllc.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Tuning for warm standby
Date: Fri, 28 Sep 2007 09:17:51 -0400
Message-ID: <b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.com> (raw)
In-Reply-To: <200709271142.07130.kevin@kevinkempterllc.com>
References: <200709271142.07130.kevin@kevinkempterllc.com>

On 9/27/07, Kevin Kempter <kevin@kevinkempterllc.com> wrote:
> Hi All;
>
> I'm preparing to fire up WAL archiving on 8 production servers We will follow
> up with implementing a warm standby scenariio.
>
> Does anyone have any thoughts per how to maximize performance, yet minimize
> the potential for data loss assuming we were not able to retrieve the final
> un-archived WAL segment from the original pg_xlog dir in the case of a crash?

the standby mechanism is actually very simple and there is very little
to do for efficient operation.  all the hard work is done inside the
wal algorithms and from the outside it works like a fancy rsync.

some performance tips:
* don't use encrypted channel (scp) to transfer wal segments from
primary to secondary.
* make sure the link between servers is gigabit at least.  bonded
ethernet couldn't hurt if you can easily fit it in your topology
* do not directly write wal segments (nfs, cifs) to the remote folder.
 whatever you use, make sure it puts files into the remote folder
atomically unless it is specifically designed to handle wal segments.
* there's not much to do on the standby side.

I've set up a few warm standby systems with pg_standby...it works
great.  I find it works best using link mode (-l) and at lest 256 wal
file before it prunes.

'archive_timeout' is a way to guarantee your last transferred file is
no older than 'x' seconds.  I am not a big fan of setting this...most
of the servers I work with are fairly busy and I'd prefer to let the
server decide when to flip files.  I would only consider setting this
in a server that had very little writing going on but what did get
written was important.

There is a new player in warm standby systems (developed by skype!):
http://pgfoundry.org/projects/skytools/

I haven't looked at it yet, but supposedly it can stream WAL files
over real time.  definately worth looking in to.  This would moot some
of the other advice I've given here.

merlin



view thread (2+ messages)

Message-ID: <b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.com>
Permalink:  ../b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: mmoncure@gmail.com, kevin@kevinkempterllc.com
  Subject: Re: Tuning for warm standby
  In-Reply-To: <b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.com>
  References: <200709271142.07130.kevin@kevinkempterllc.com> <b42b73150709280617u130f4e22o8ee384b12bca315a@mail.gmail.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