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

From David Kerr
Subject Re: Measurin the lag between a master and a replica
Date
Msg-id 68AF7114-F8F0-44EC-8C86-80F08DEE5D78@mr-paradox.net
Whole thread Raw
In response to Re: Measurin the lag between a master and a replica  (Sergey Konoplev <sergey.konoplev@postgresql-consulting.com>)
List pgsql-admin
On Jul 19, 2012, at 9:03 PM, Sergey Konoplev wrote:

> 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.


Good caveat! monitor the connection status separately as well!



pgsql-admin by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Measurin the lag between a master and a replica
Next
From: Sergey Konoplev
Date:
Subject: Re: ERROR: there is no parameter $1