Re: Correct query to check streaming replication lag

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: Correct query to check streaming replication lag
Дата
Msg-id CADp-Sm5PzvwjwG=mc_i=DKKU_-V62LQP4rMvi+Dem05NvOQXgg@mail.gmail.com
обсуждение исходный текст
Ответ на Correct query to check streaming replication lag  (Granthana Biswas <granthana@zedo.com>)
Ответы Re: Correct query to check streaming replication lag
Список pgsql-general


On Fri, Jan 17, 2014 at 5:31 PM, Granthana Biswas <granthana@zedo.com> wrote:


Thank you Sameer for your reply. Is there any other query that would help get exact replication lag?


You 2nd Query is the most accurate you can get. 
 
2. 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;
For reason same as above, this won't be exact but the most accurate you can get.
You can get lags in terms of bytes (and I have always believed that makes more sense).


May I ask, why are you looking for this info? Is it purely monitoring?

Regards
Sameer
Ashnik Pte Ltd.

В списке pgsql-general по дате отправления:

Предыдущее
От: Sameer Kumar
Дата:
Сообщение: Re: Correct query to check streaming replication lag
Следующее
От: Granthana Biswas
Дата:
Сообщение: Re: Correct query to check streaming replication lag