Skip site navigation (1) Skip section navigation (2)

Re: Measurin the lag between a master and a replica

From: Sergey Konoplev <sergey(dot)konoplev(at)postgresql-consulting(dot)com>
To: David Kerr <dmk(at)mr-paradox(dot)net>
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:03:04
Message-ID: CAL_0b1s3Q-vEViErGOOeCZK=hCFyr9eXRqySH8H1cs4TXNRy3Q@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
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.

-- 
Sergey Konoplev

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

Jabber: gray(dot)ru(at)gmail(dot)com Skype: gray-hemp Phone: +79160686204

In response to

Responses

pgsql-admin by date

Next:From: David KerrDate: 2012-07-20 04:10:50
Subject: Re: Measurin the lag between a master and a replica
Previous:From: Madhu.LankaDate: 2012-07-20 02:33:36
Subject: ERROR: there is no parameter $1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group