Answer the question
In order to leave comments, you need to log in
How can you calculate the master-slave replication latency. postgres 9.2.7?
How can I calculate master-slave replication latency in postgres?
I get the value of the lag, but this value is quite abstract, I would like to get exactly the delay time.
Answer the question
In order to leave comments, you need to log in
select now() - pg_last_xact_replay_timestamp();
run on standby via psql, get the lag in seconds.
Mhm. There is one universal way for all bases.
In a separate table on the master every second-five-ten (depending on the desired error and load) write the current time. And on the replica, check how much this table lags behind real time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question