pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Check replication lag
5+ messages / 4 participants
[nested] [flat]

* Check replication lag
@ 2020-08-05 19:01 Sreejith P <sreejith@lifetrenz.com>
  2020-08-06 02:28 ` Re: Check replication lag Thomas Munro <thomas.munro@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Sreejith P @ 2020-08-05 19:01 UTC (permalink / raw)
  To: pgsql-general

Hi,

Am using SELECT (now() - pg_last_xact_replay_timestamp()) < '1’) min for identifying replication lag. Is there any better option available in postgres 10.

IN SYNC mode of replication what would be the impact on Master DB server in terms of over all performance  ?





Thanks
Sreejith.

-- 




 

*Solutions for Care Anywhere*
*dWise HealthCare IT Solutions Pvt. 
Ltd.* | www.lifetrenz.com <http://www.lifetrenz.com;
*Disclaimer*:
 The 
information and attachments contained in this email are intended 
for 
exclusive use of the addressee(s) and may contain confidential or 

privileged information. If you are not the intended recipient, please 

notify the sender immediately and destroy all copies of this message and
 
any attachments. The views expressed in this email are, unless 
otherwise 
stated, those of the author and not those of dWise HealthCare IT Solutions 
or its management.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Check replication lag
  2020-08-05 19:01 Check replication lag Sreejith P <sreejith@lifetrenz.com>
@ 2020-08-06 02:28 ` Thomas Munro <thomas.munro@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Thomas Munro @ 2020-08-06 02:28 UTC (permalink / raw)
  To: Sreejith P <sreejith@lifetrenz.com>; +Cc: pgsql-general

On Thu, Aug 6, 2020 at 7:02 AM Sreejith P <sreejith@lifetrenz.com> wrote:
> IN SYNC mode of replication what would be the impact on Master DB server in terms of over all performance  ?

The pg_stat_replication columns write_lag, flush_lag and replay_lag
are designed tell you how long to expect commits to take for
synchronous standbys, based on recent history, if synchronous_commit
it set to remote_write, on or remote_apply respectively.  Those times
tell you about commit latency, which limits sequential commit rate for
each session.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Check Replication lag
@ 2021-10-11 12:28 Pawan Sharma <pawanpg0963@gmail.com>
  2021-10-11 12:52 ` Re: Check Replication lag hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Pawan Sharma @ 2021-10-11 12:28 UTC (permalink / raw)
  To: pgsql-general

Hello Team,

Is there a way to monitor the replication lag, where replica nodes are
configured through aws s3.

Is not in a synced replica setup where master node will push the wal files
to aws s3 and we are taking and replaying those wal files on a replica node.

-Pawan

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Check Replication lag
  2021-10-11 12:28 Check Replication lag Pawan Sharma <pawanpg0963@gmail.com>
@ 2021-10-11 12:52 ` hubert depesz lubaczewski <depesz@depesz.com>
  2021-10-11 16:59   ` Re: Check Replication lag Pawan Sharma <pawanpg0963@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: hubert depesz lubaczewski @ 2021-10-11 12:52 UTC (permalink / raw)
  To: Pawan Sharma <pawanpg0963@gmail.com>; +Cc: pgsql-general

On Mon, Oct 11, 2021 at 05:58:03PM +0530, Pawan Sharma wrote:
> Is there a way to monitor the replication lag, where replica nodes are
> configured through aws s3.

You can check it on replica, by issuing:
select now() - pg_last_xact_replay_timestamp();

and it will show you, more or less, what is your current lag.

Best regards,

depesz






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Check Replication lag
  2021-10-11 12:28 Check Replication lag Pawan Sharma <pawanpg0963@gmail.com>
  2021-10-11 12:52 ` Re: Check Replication lag hubert depesz lubaczewski <depesz@depesz.com>
@ 2021-10-11 16:59   ` Pawan Sharma <pawanpg0963@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Pawan Sharma @ 2021-10-11 16:59 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: pgsql-general

Hello  Depesz,

Thanks for your quick response, let me give some overview of our cluster
setups.  Actually we have a Patroni cluster running with one replica
(Replica 1) in the same data center with no data lag. whereas we have
configured one more replica(Replica 2) in a different data center
through AWS S3 WAL shipping and replaying.

So we can easily check Patroni replica (Replica1) lag using the patronictl
list command. but I am looking how I can check replication lag of Replica 2
which is configured through AWS.

As I have checked with above query I am getting same response from both the
replicas. whereas on Replica2 there is some lag exist.


I have created dummy table on master node and its synced on replica1
simultaneously but it taking hours to sync on replica2.


Regards,
Pawan







On Mon, Oct 11, 2021 at 6:22 PM hubert depesz lubaczewski <depesz@depesz.com>
wrote:

> On Mon, Oct 11, 2021 at 05:58:03PM +0530, Pawan Sharma wrote:
> > Is there a way to monitor the replication lag, where replica nodes are
> > configured through aws s3.
>
> You can check it on replica, by issuing:
> select now() - pg_last_xact_replay_timestamp();
>
> and it will show you, more or less, what is your current lag.
>
> Best regards,
>
> depesz
>
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-10-11 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 19:01 Check replication lag Sreejith P <sreejith@lifetrenz.com>
2020-08-06 02:28 ` Thomas Munro <thomas.munro@gmail.com>
2021-10-11 12:28 Check Replication lag Pawan Sharma <pawanpg0963@gmail.com>
2021-10-11 12:52 ` Re: Check Replication lag hubert depesz lubaczewski <depesz@depesz.com>
2021-10-11 16:59   ` Re: Check Replication lag Pawan Sharma <pawanpg0963@gmail.com>

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