According to this web article, the hot_standby_feedback parameter makes use of the vacuum_defer_cleanup_age parameter to calculate when it will send updates? According to the postgres documentation, in the vacuum_defer_cleanup_age section it states:

You should also consider setting hot_standby_feedback on standby server(s) as an alternative to using this parameter.

These two sources seem to contradict. Don't they? One seems to deprecate the old value and the other seems to utilize it in the algorithm used to determine when or what to send for feedback. I'm not sure which.

I might be wrong, but I think I can see value in having both working in tandem. Say I want the subscriber to send messages to the master every 10 seconds, but this is not fast enough during peak load times to notify the master before the data reaches vacuum_defer_cleanup_age. In this case, the master would vacuum and queries on the slave would be cancelled. However, this situation is preferable in cases where I have a hard limit on bloat that is better measured in transactions than time -- which can already be accomplished via old_snapshot_threshold.

I would appreciate any help understanding this better.

1 Answer 1


I cannot deduce from the article to which you link that hot_standby_feedback uses vacuum_defer_cleanup_age. It doesn't. In fact, vacuum_defer_cleanup_age has been removed in v17 by commit 1118cd37eb. It has been deemed unnecessary, as a combination of statement_timeout and hot_standby_feedback on the standby can do the same thing as the removed parameter and will give you better control.

  • Am i correct in assuming this would mean i would need to separate my short running from my long running queries? Some up to 30 minutes.
    – user68052
    Commented Jul 14, 2023 at 16:07
  • Thank you for your help btw.
    – user68052
    Commented Jul 14, 2023 at 16:12
  • Can you also suggest a good value for vacuum_defer_cleanup_age such that it does not get used? I'm on postgres 14
    – user68052
    Commented Jul 14, 2023 at 16:54
  • Don't use vacuum_defer_cleanup_age. Use hot_standby_feedback. If you want long running queries on the standby to succeed reliably, you need to increase max_standby_streaming_delay, and replication will be delayed. See my article for details. Commented Jul 14, 2023 at 19:07
  • This raises alot more questions :( Unfortunately i'm new to this platform and can't ask more. It you'd indulge me, what is the primary tradeoff between max_standby_streaming_delay vs. old_snapshot_threshold. Just a guess but I would think the latter when paired with hot_standby_feedback would be more suitable in my case where i'm trying to use long and short queries in a single replica.
    – user68052
    Commented Jul 14, 2023 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.