Measuring replication lag time

From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: "List, Postgres" <pgsql-general(at)postgresql(dot)org>
Subject: Measuring replication lag time
Date: 2012-02-22 12:10:32
Message-ID: CADmi=6MBfhta6a4L3QVy4UN6xH8oj_CQ7+jLP1dui8TjZ9j4yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.

I need to measure how far in the past a hot standby is, async
streaming replication.

On the Hot Standby, "select
age(current_timestamp,pg_last_xact_replay_timestamp())" gets me this
(or close enough for my purposes - I understand that if there are no
updates, there are no logs to replay and the lag time will increase).

Is there some way to get this same information on the master?
pg_stat_replication contains the log information, but I can't see how
to map this to a timestamp.

Is there a better way of measuring this?

--
Stuart Bishop <stuart(at)stuartbishop(dot)net>
http://www.stuartbishop.net/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniele Varrazzo 2012-02-22 12:18:16 Re: python3 module for accessing postgresql
Previous Message Andrew Gould 2012-02-22 11:10:34 python3 module for accessing postgresql