Re: Metric to calculate WAL size left to transfer to Standby

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Metric to calculate WAL size left to transfer to Standby
Дата
Msg-id 8b82e5714c39d82cc57a732b2b32f45504793915.camel@cybertec.at
обсуждение исходный текст
Ответ на Metric to calculate WAL size left to transfer to Standby  (Viral Shah <vshah@nodalexchange.com>)
Ответы Re: Metric to calculate WAL size left to transfer to Standby  (Viral Shah <vshah@nodalexchange.com>)
Список pgsql-general
On Wed, 2021-04-14 at 17:50 -0400, Viral Shah wrote:
> We have a PostgreSQL 10.12 cluster of servers in two different data centers.
>  Off lately, in the case of a large WAL generation, we are seeing replication
>  delay between the master and the standby server. These delays have off lately
>  been there for an unusually long time. I was wondering if we have any metric
>  that can calculate the amount (size) of WAL transfer left between master and
>  standby?
> 
> PS: We have ensured we have upgraded our firewalls for better speed transfer.
> 
> Any help on how to figure out the slowness in the WAL transfer would be much appreciated.

SELECT pg_wal_lsn_diff(pg_current_wal_lsn(), flush_lsn) AS transfer_lag,
       pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn) AS replay_lag
FROM pg_stat_replication;

If both are delayed, it might be that the network cannot cope.

If only the second number is delayed, you have replication conflicts
with queries on the standby.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Vulnerability PostgreSQL 11.2
Следующее
От: Mike Rylander
Дата:
Сообщение: Re: Timestamp/hstore query?