Vacuum of large tables causing replication delays to hot standby

From: Jeff Mcdowell <Jeff(dot)Mcdowell(at)panerabread(dot)com>
To: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Vacuum of large tables causing replication delays to hot standby
Date: 2016-04-30 14:40:34
Message-ID: D34A2E0F.24876%jeff.mcdowell@panerabread.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello All,

In an attempt to offload some of the pressure off our master postgres node,
We recently decided to start running reports off of our hot-standby.

There is a desire for these reports to return fairly current data, so we have been monitoring the replication delay between the master -> standby.
We currently have max_standby_archive_delay and max_streaming_archive_delay set to -1, to avoid any timeouts in the application (when pulling reports).
hot_standby_feedback is enabled on the slave node, but we are not currently setting vacuum_defer_cleanup_age.

95% of the time, the delay is only microseconds. But we have discovered that whenever the master does an auto vacuum of a large table, the transaction replay delay can climb is high as 1 hour. These delays don’t seem to correlate with any particular queries that are running against the master or the standby, and the delay only subsides when the vacuum completes.

Does anyone have any recommendations for a configuration that can minimize the replay delays that occur during the vacuums of large tables.

--
Thank you,
Jeff McDowell
Email: Jeff(dot)mcdowell(at)panerabread(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Devoy 2016-04-30 15:17:22 Re: Skip trigger?
Previous Message Rafal Pietrak 2016-04-30 13:32:07 Re: Why are data files stored in /var/lib