Re: PostgreSQL 9.2 high replication lag

From: Lucas <root(at)sud0(dot)nz>
To:
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL 9.2 high replication lag
Date: 2021-07-15 22:38:23
Message-ID: RU6H0W6rPBEtSJyCna38pN176ut44rL1OHkHOCv4ZRTGyCLqnNZ2WiNweHP4EHWoCUPGlI-52p8EwZMfGQCAcp_von52j-D8dSQ53oUXpH4=@sud0.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, July 15th, 2021 at 10:34 PM, Lucas <root(at)sud0(dot)nz> wrote:

> ‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>

> On Wednesday, July 14th, 2021 at 5:30 PM, Laurenz Albe laurenz(dot)albe(at)cybertec(dot)at wrote:
>

> On Tue, 2021-07-13 at 20:14 -0700, David G. Johnston wrote:
>

> > > On Tue, Jul 13, 2021 at 8:01 PM Lucas root(at)sud0(dot)nz wrote:
> > >

> > > > According to the documentation, max_standby_streaming_delay is a configuration parameter
> > > >

> > > > determining how long a standby server should wait before canceling queries that conflict
> > > >

> > > > with pending WAL entries received via streaming replication.
> > > >

> > > > My question then is: Which queries, if the slave can only receive SELECTs?
> > >

> > > The select queries...
> > >

> > > Follow the link in the docs for max_stanbdy_steaming_delay to:
> > >

> > > https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT
> > >

> > > for the details.
> >

> > Perhaps you might find the following article interesting, where I tried to
> >

> > discuss this topic in some depth:
> >

> > https://www.cybertec-postgresql.com/en/streaming-replication-conflicts-in-postgresql/
>

> Thanks!
>

> I have changed max_standby_streaming_delay from -1 to 120s. However, I can still see the replication being delayed for up to 3 minutes quite frequent.
>

> I will try to see if I can find what kind of query is causing that... Maybe via pg_stat_database_conflicts?

[Screen Shot 2021-07-16 at 10.32.07 AM.png]

At 10pm (red mark) yesterday I changed the max_standby_streaming_delay = -1 to max_standby_streaming_delay = 120s.

However, it hasn't changed and the replication lag is still high all the time.

I'm deploying a new slave server but it will be in the same AZ as its master. And will monitor there and replication lag.

Please, let me know if you guys have any other suggestions.

Attachment Content-Type Size
publickey - root@sud0.nz - 0xC5E964A1.asc application/pgp-keys 3.2 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Markhof, Ingolf 2021-07-16 12:42:53 dealing with dependencies
Previous Message Francisco Olarte 2021-07-15 17:26:12 Re: pg_dumpall with individual output files per database?