on
for all standby servers that need to serve read queries. This should be configured in the recovery.conf or postgresql.auto.conf of the standby server. Ensure adequate hardware resources to handle both recovery and query workload.off
is recommended unless you experience frequent query conflicts. Set to on
if you have long-running queries on standbys that frequently conflict with vacuum operations. Monitor table bloat on the primary when enabled.30s
is reasonable. Increase to 60-120s
for environments with longer reporting queries. Set to -1
(infinity) only if query completion is more important than replication lag, but monitor lag carefully.30s
is appropriate for most setups. Increase to 60-90s
for environments with complex analytical queries on standbys. For critical reporting standbys, consider higher values while monitoring replication lag.'host=primary-host user=replication password=secret port=5432 sslmode=require'
. Always use SSL encryption for replication connections. Store passwords in .pgpass files rather than in the configuration for better security.'standby1_slot'
. Ensure the slot exists on the primary (SELECT * FROM pg_create_physical_replication_slot('standby1_slot');
). Monitor slot usage to prevent unlimited WAL accumulation.0
(no delay). Set to values like 1h
or 4h
for protection against operational errors. Balance between protection needs and storage requirements, as delayed replication requires more WAL storage.on
if using logical replication with physical standbys for high availability. This ensures logical replication can continue after failover. Requires appropriate slot configuration on both primary and standby.off
is recommended. Use permanent slots for production replication instead. Temporary slots might be useful for ad-hoc replication setups but lack the reliability of permanent slots.10s
is reasonable. Decrease to 5s
for environments requiring faster failure detection. Increase to 30s
for WAN connections with higher latency, but monitor replication health carefully.60s
is appropriate for most environments. Increase to 120s
for WAN connections or during periods of known low write activity. Decrease to 30s
for environments requiring rapid failure detection.5s
is reasonable. Decrease to 1-2s
for critical systems where minimal lag is important. Increase to 10-30s
for unreliable network connections to avoid overwhelming the network with retries.Start your journey toward a healthier PostgreSQL with pghealth.
You can explore all features immediately with a free trial β no installation required.
π Start Free Trial