Re: Correct query to check streaming replication lag

From: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
To: Granthana Biswas <granthana(at)zedo(dot)com>
Cc: Ray Stell <stellr(at)vt(dot)edu>, PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>
Subject: Re: Correct query to check streaming replication lag
Date: 2014-01-21 05:33:41
Message-ID: CADp-Sm6ZEhVhKe=u=AJZD1DC=EbJvS5Wnxg=wkPrrZGONwGNaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>
>
> We are already using the following query:
>
> SELECT CASE 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;
>
> This is (delay) not the correct thing to monitor.

We cannot use pg_xlog_location_diff as we use postgresql 9.1.
>
> You can still use the other two methods I mentioned.

Regards
Sameer
Ashnik Pte Ltd, Singapore

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Granthana Biswas 2014-01-21 06:11:52 Re: Correct query to check streaming replication lag
Previous Message Granthana Biswas 2014-01-21 05:19:55 Re: Correct query to check streaming replication lag