Check replication lag

Started by Sreejith Pover 5 years ago2 messagesgeneral
Jump to latest
#1Sreejith P
sreejith@lifetrenz.com

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&gt;
*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.

#2Thomas Munro
thomas.munro@gmail.com
In reply to: Sreejith P (#1)
Re: Check replication lag

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.