[Pgpool-general] Master and only one slave?

Brad Nicholson bnichols at ca.afilias.info
Thu Aug 3 18:58:12 UTC 2006


On Wed, 2006-08-02 at 15:55 -0700, Jeff Davis wrote:
> I am using Slony to replicate master/slave and I would like to use
> pgpool in front for connection pooling and the load balancing of
> selects.
> 
> I have a few questions though. First, why are only two servers allowed?
> Why not allow load balancing across as many servers as I have? It seems
> logical that you could have any number of servers, each with an
> arbitrary weight greater than or equal to zero. 
> 
> What can I expect as far as changes to the way the applications need to
> interact? What situations do I need to be careful of where
> master_slave_mode does not work like a single server? I understand that
> there is a small lag time between the master and the slave (so a SELECT
> could potentially return something different depending on where the
> SELECT is sent), any other issues?

Regarding the issue with SELECTS - if you put you SELECT inside a
transaction, it will always direct it towards the master.  This gives
you control over queries that must have the latest data.

I think you should plan for the scenario that your slony replica is
falling further behind than a planned small lag time.  A burst of
traffic, network issues, a slon falling over can all cause a replica to
fall further out of sync than you might care for.

You also have to be aware of the fact that any write operation that is
outside of a transaction might get redirected to the subscriber, which
the slony triggers will cause to fail.

Brad.
 



More information about the Pgpool-general mailing list