From: Williams, Alex <awilliams@teamdrg.com>
To: Yaser Raja <yrraja@gmail.com>
To: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: Williams, Alex <awilliams@teamdrg.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Question on Hot Standby in PostgreSQL
Date: Wed, 25 Nov 2015 21:12:30 +0000
Message-ID: <D27B8CCE.111FF9%awilliams@dresourcesgroup.com> (raw)
In-Reply-To: <CALkbEVnROXHJixwHfvjd8y7d8MRhvoxoifTvgEfAwprKYMRqJA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Hi Laurenz and Raja,
Thank you both for your feedback and insight, I really appreciate it. I think I'll leave it with -1 (since we may add columns in the future and other possible DDL changes,) so we'll schedule downtime on the standby at least 1x a week for cleaning up the master.
Again, I thank everyone for your help, this really helped my situation.
Happy Thanksgiving and Best Regards,
Alex
P.S. If anyone is ever in NJ, let me know, lunch is on me :)
From: Yaser Raja <yrraja@gmail.com<mailto:yrraja@gmail.com>>
Date: Wednesday, November 25, 2015 3:57 PM
To: Albe Laurenz <laurenz.albe@wien.gv.at<mailto:laurenz.albe@wien.gv.at>>
Cc: "Williams, Alex" <awilliams@teamdrg.com<mailto:awilliams@teamdrg.com>>, Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>, "pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>" <pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>>
Subject: Re: [ADMIN] Question on Hot Standby in PostgreSQL
On Wed, Nov 25, 2015 at 3:43 AM, Albe Laurenz <laurenz.albe@wien.gv.at<mailto:laurenz.albe@wien.gv.at>> wrote:
Alex Williams wrote:
> Concerning these two params below, when using hot_standby_feedback, what would you set them if you
> had the situation where you had queries constantly running on the standby, some quick and some long,
> practically all day/night, everyday?
>
> max_standby_archive_delay (integer)
> max_standby_streaming_delay (integer)
> Should I still keep them as -1 (infinite)?
I'd say set them both to 0.
If you have hot_standby_feedback=on, the primary will not remove any rows still
needed on the standby, so there should never be a need to delay WAL application.
hot_standby_feedback will significantly reduce the conflicts but it will not totally eliminate them. For example if a new column is added to a table, any query using this table on slave will be cancelled to apply this change.
IF query cancellation is totally not acceptable then you will have to set these delays to -1.
The drawback is that you may get considerable bloat on the primary if many
DELETE/UPDATE operation are going on and queries on the standby take a long time.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: awilliams@teamdrg.com, yrraja@gmail.com, laurenz.albe@wien.gv.at, scott_ribe@elevated-dev.com
Subject: Re: Question on Hot Standby in PostgreSQL
In-Reply-To: <D27B8CCE.111FF9%awilliams@dresourcesgroup.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox