public inbox for [email protected]  
help / color / mirror / Atom feed
Possible causes of high_replay lag, given replication settings?
2+ messages / 2 participants
[nested] [flat]

* Possible causes of high_replay lag, given replication settings?
@ 2025-07-18 20:29  Jon Zeppieri <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Jon Zeppieri @ 2025-07-18 20:29 UTC (permalink / raw)
  To: [email protected]

Hi,

I just had a situation where physical replication fell far behind
(hours). The write and flush lag times were 0, but replay_lag was
high. The replica has hot_standby_feedback on, and both
max_standby_streaming_delay and max_standby_archive_delay are set to
30s.

What could cause a situation like this? If the network were a problem,
I'd expect the other _lag times to be high. So it appears that the
replica was getting the WAL but was unable to apply it. Are there
situations where the replica cannot apply WAL other than the kinds of
conflicts that would be addressed by the _delay settings?

I checked pg_stat_database_conflicts, but there was nothing in it -- all zeros.

- Jon






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Possible causes of high_replay lag, given replication settings?
@ 2025-07-23 20:27  Nick Cleaton <[email protected]>
  parent: Jon Zeppieri <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Nick Cleaton @ 2025-07-23 20:27 UTC (permalink / raw)
  To: Jon Zeppieri <[email protected]>; +Cc: [email protected]

On Fri, 18 Jul 2025 at 21:29, Jon Zeppieri <[email protected]> wrote:
>
> I just had a situation where physical replication fell far behind
> (hours). The write and flush lag times were 0, but replay_lag was
> high. The replica has hot_standby_feedback on, and both
> max_standby_streaming_delay and max_standby_archive_delay are set to
> 30s.
>
> What could cause a situation like this? If the network were a problem,
> I'd expect the other _lag times to be high. So it appears that the
> replica was getting the WAL but was unable to apply it. Are there
> situations where the replica cannot apply WAL other than the kinds of
> conflicts that would be addressed by the _delay settings?
>
> I checked pg_stat_database_conflicts, but there was nothing in it -- all zeros.

This can happen when there are several busy writing processes on the
primary. The single replay process on the replica can't keep up with
the writes.






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-07-23 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-18 20:29 Possible causes of high_replay lag, given replication settings? Jon Zeppieri <[email protected]>
2025-07-23 20:27 ` Nick Cleaton <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox