Skip to content

recovery_min_apply_delay

recovery_min_apply_delay sets the minimum delay for applying changes during recovery. It is a sighup setting present in PG12–18; the latest recorded boot default is 0 ms.
Note

Fact — official short description: “Sets the minimum delay for applying changes during recovery.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valuesighup
Takes effect after configuration reload
Unit , Valuems
Raw unit
Range , Value02147483647
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueReplication / Standby Servers
Upstream classification
Latest boot value , Value0
0 ms

Lifecycle

Fact Value
First observed PG12
Present in PG12–19 Beta 3
Removed in No
Introduction commit 2dedf4d9a899 — Integrate recovery.conf into postgresql.conf
Commit date 2018-11-25
Discussion thread 1

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG12–19 Beta 3 0 ms 0 ms

How it works

Sets the minimum delay for applying changes during recovery. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

A standby delays replay of each transaction commit until the configured time has elapsed since the primary’s commit timestamp. Network/cascade lag counts toward the delay, clocks matter, and synchronous_commit=remote_apply makes primary commits wait through the intentional delay.

Monitor and change recovery_min_apply_delay together with max_standby_archive_delay, max_standby_streaming_delay, hot_standby. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Size recovery_min_apply_delay from topology, failover roles, slot/subscription count, and reconnect headroom. Test worst-case primary latency, standby replay, and disk retention before production.
OLAP Read standbys and logical subscribers often see long queries or large transactions. Put explicit bounds on replay/apply and monitor lag, worker saturation, slot restart_lsn, and conflict cancellations.
Small nodes Configure only replication capacity that is actually used. Even a small topology needs bounded timeouts and slot lifecycle; unlimited retention is not reliability.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified
OLAP Unmodified
CRIT Unmodified
TINY Unmodified
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG12–19 Beta 3 unmodified; OLAP: PG12–19 Beta 3 unmodified; CRIT: PG12–19 Beta 3 unmodified; TINY: PG12–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Changing it on the wrong primary, standby, sender, or subscriber role.
  • Watching only configured bytes/time instead of actual lag, slot position, and worker state.
  • Failing over to a node that lacks the old primary’s capacity or prerequisites.
  • Using infinite waits or WAL retention to hide a failed consumer.

max_standby_archive_delay · max_standby_streaming_delay · hot_standby · hot_standby_feedback · primary_conninfo · primary_slot_name

References