pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ben Chobot <bench@silentmedia.com>
To: pgsql-general@postgresql.org
Subject: streaming slaves can't keep up?
Date: Tue, 31 Mar 2020 10:52:27 -0700
Message-ID: <ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.com> (raw)

We have a few busy 9.5 dbs, both streaming to a few slaves each. The 
master and slaves are identical hardware and are getting no small amount 
of load - about 45k transactions/s on the master and ~36k transactions/s 
on the slave actively serving clients. During these busy times, queries 
are all fairly responsive (mostly well under <1s) on both master and 
slave, and according to pg_stat_replication, replication is mostly good 
- the flush_location for all slaves seems quite up to date. But the 
replay_location on those busy slaves falls behind by quite a lot (over 
an hour behind), and this is a problem. On the slaves which aren't 
taking client load, their replay_location remains close to the 
flush_location.

Does it make sense that the reason this is happening is because all 
those queries, which are quick but quite numerous, are causing the 
replay to slow down? If so, my hope is that we can simply throw more 
slaves at the problem, reducing the amount of queries and therefore 
allowing the replication to not get blocked as often. But if that theory 
is nonsense, I'm going to need a different solution.

Message-ID: <ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.com>
Permalink:  ../ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.com/
Also on:    postgresql.org/message-id/ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.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-general@postgresql.org
  Cc: bench@silentmedia.com
  Subject: Re: streaming slaves can't keep up?
  In-Reply-To: <ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.com>
  References: <ba006cb5-407e-cb3f-c9f3-48978d2d8d19@silentmedia.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