No need to touch hot_standby_feedback
. As others have mentioned, setting it to on
can bloat master. Imagine opening transaction on a slave and not closing it.
Instead, set max_standby_archive_delay
and max_standby_streaming_delay
to some sane value:
# /etc/postgresql/10/main/postgresql.conf on a slave
max_standby_archive_delay = 900s
max_standby_streaming_delay = 900s
This way queries on slaves with a duration less than 900 seconds won't be cancelled. If your workload requires longer queries, just set these options to a higher value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…