pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui DeSousa <rui@crazybean.net>
To: Mark Steben <mark.steben@drivedominion.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Another streaming replication question
Date: Tue, 6 Nov 2018 16:09:49 -0500
Message-ID: <8BB7D7D1-8AD0-4350-8A1F-D28ABCDF3AB7@crazybean.net> (raw)
In-Reply-To: <CADyzmyys52hHwdYXAx3FPeTHuPk3V_ewL2bCoOXNfRieeRqPjA@mail.gmail.com>
References: <CADyzmyys52hHwdYXAx3FPeTHuPk3V_ewL2bCoOXNfRieeRqPjA@mail.gmail.com>



> On Nov 6, 2018, at 12:13 PM, Mark Steben <mark.steben@drivedominion.com> wrote:
> 
>    1.  Can streaming replication work in this high-load situation?

Yes, given you have low latency and the bandwidth to support it.  

Need to plan for cases when streaming does fall behind too; don’t want streaming to just break.

Some options:

1. Replication slot on the upstream sever
2. Allow streaming to fallback to restoring WALs from archive
3. Both of the above options


>    2.  What, if anything, can I do to make it work better?  Perhaps convert to cascade? Master -->standby1 ---> standby2

That would help in managing you bandwidth between nodes.


There is a lot to consider and it really depends on your use cases and your application/queries.

A few rhetorical questions: 

What is the replicas being used for?  
What an acceptable replication lag?
What an acceptable apply lag?
Should queries be killed to apply replica transactions?
What’s your vacuum strategy as that impacts replicas?

These two parameters I find invaluable (their validity depends on your use case). 

hot_standby_feedback = true
max_standby_streaming_delay = 30s

The other big thing is query performance and I/O as each has a large impact on replication lag.  So plan for tuning.=

view thread (5+ messages)  latest in thread

Message-ID: <8BB7D7D1-8AD0-4350-8A1F-D28ABCDF3AB7@crazybean.net>
Permalink:  ../8BB7D7D1-8AD0-4350-8A1F-D28ABCDF3AB7@crazybean.net/
Also on:    postgresql.org/message-id/8BB7D7D1-8AD0-4350-8A1F-D28ABCDF3AB7@crazybean.net

 · 

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-admin@postgresql.org
  Cc: rui@crazybean.net, mark.steben@drivedominion.com
  Subject: Re: Another streaming replication question
  In-Reply-To: <8BB7D7D1-8AD0-4350-8A1F-D28ABCDF3AB7@crazybean.net>

* 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