Re: Measurin the lag between a master and a replica

From: David Kerr <dmk(at)mr-paradox(dot)net>
To: Sergey Konoplev <sergey(dot)konoplev(at)postgresql-consulting(dot)com>
Cc: Ali Pouya <alipouya2(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Measurin the lag between a master and a replica
Date: 2012-07-20 04:10:50
Message-ID: 68AF7114-F8F0-44EC-8C86-80F08DEE5D78@mr-paradox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)mr-paradox(dot)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!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sergey Konoplev 2012-07-20 04:25:58 Re: ERROR: there is no parameter $1
Previous Message Sergey Konoplev 2012-07-20 04:03:04 Re: Measurin the lag between a master and a replica