Re: Correct query to check streaming replication lag

Поиск
Список
Период
Сортировка
От Ray Stell
Тема Re: Correct query to check streaming replication lag
Дата
Msg-id 82CA6C38-89A6-45E9-B5D1-C2E24B2962D5@vt.edu
обсуждение исходный текст
Ответ на Re: Correct query to check streaming replication lag  (Granthana Biswas <granthana@zedo.com>)
Ответы Re: Correct query to check streaming replication lag
Список pgsql-general

On Jan 17, 2014, at 5:07 AM, Granthana Biswas <granthana@zedo.com> wrote:

Yes it's purely for monitoring purpose.


I use the pg_controldata cmd locally and via bash/ssh shared keys and compare various values that seem interesting such as "Time of latest checkpoint, Latest checkpoint location."  My interest is recoverability and checkpoints seemed relevant at the time.  

I found a comment in the docs:


"pg_xlog_location_diff calculates the difference in bytes between two transaction log locations. It can be used with pg_stat_replication or some functions shown in Table 9-59 to get the replication lag."

and 

"The functions shown in Table 9-60 provide information about the current status of the standby. These functions may be executed both during recovery and in normal running."  

These look interesting wrt lag studies and seem to work on the stby:

template1=# select pg_last_xlog_receive_location();
 pg_last_xlog_receive_location 
-------------------------------
 18/9E000000
(1 row)

template1=# select pg_last_xlog_replay_location();
 pg_last_xlog_replay_location 
------------------------------
 18/9E000000
(1 row)



Вложения

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

Предыдущее
От: Granthana Biswas
Дата:
Сообщение: Re: Correct query to check streaming replication lag
Следующее
От: Jeff Ross
Дата:
Сообщение: Question about plan difference between 9.3 and 9.3.2