Re: Measurin the lag between a master and a replica - Mailing list pgsql-admin

From Sergey Konoplev
Subject Re: Measurin the lag between a master and a replica
Date
Msg-id CAL_0b1s3Q-vEViErGOOeCZK=hCFyr9eXRqySH8H1cs4TXNRy3Q@mail.gmail.com
Whole thread Raw
In response to Re: Measurin the lag between a master and a replica  (David Kerr <dmk@mr-paradox.net>)
Responses Re: Measurin the lag between a master and a replica  (David Kerr <dmk@mr-paradox.net>)
List pgsql-admin
On Fri, Jul 20, 2012 at 1:02 AM, David Kerr <dmk@mr-paradox.net> wrote:
> I was looking into this last month and some nice folks on the list pointed me to this formula
> for calculating lag. (to be run on the slave) similar to what Sergey said.
>
>         when pg_last_xlog_receive_location() = pg_last_xlog_replay_location()
>         then 0
>         else extract ('epoch' from now()-pg_last_xact_replay_timestamp()) end as log_delay;

If you have a connection problem this will not reflect the situation.

--
Sergey Konoplev

a database architect, software developer at PostgreSQL-Consulting.com
http://www.postgresql-consulting.com

Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204

pgsql-admin by date:

Previous
From: "Madhu.Lanka"
Date:
Subject: ERROR: there is no parameter $1
Next
From: David Kerr
Date:
Subject: Re: Measurin the lag between a master and a replica