From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Beena Emerson <memissemerson(at)gmail(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | segment size depending *_wal_size defaults (was increasing the default WAL segment size) |
Date: | 2017-08-30 00:36:10 |
Message-ID: | 20170830003610.3xcr4hc3a7cee7ra@alap3.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
intentionally breaking the thread here, I want this one point to get
a bit wider audience.
The excerpt of the relevant discussion is:
On 2017-08-23 12:13:15 +0530, Beena Emerson wrote:
> >> + /* set default max_wal_size and min_wal_size */
> >> + snprintf(repltok, sizeof(repltok), "min_wal_size = %s",
> >> + pretty_wal_size(DEFAULT_MIN_WAL_SEGS));
> >> + conflines = replace_token(conflines, "#min_wal_size = 80MB", repltok);
> >> +
> >> + snprintf(repltok, sizeof(repltok), "max_wal_size = %s",
> >> + pretty_wal_size(DEFAULT_MAX_WAL_SEGS));
> >> + conflines = replace_token(conflines, "#max_wal_size = 1GB", repltok);
> >> +
> >
> > Hm. So postgresql.conf.sample values are now going to contain misleading
> > information for clusters with non-default segment sizes.
> >
> > Have we discussed instead defaulting min_wal_size/max_wal_size to a
> > constant amount of megabytes and rounding up when it doesn't work for
> > a particular segment size?
>
> This was not discussed.
>
> In the original code, the min_wal_size and max_wal_size are computed
> in the guc.c for any wal_segment_size set at configure.
>
> {
> {"min_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS,
> gettext_noop("Sets the minimum size to shrink the WAL to."),
> NULL,
> GUC_UNIT_MB
> },
> &min_wal_size_mb,
> 5 * (XLOG_SEG_SIZE / (1024 * 1024)), 2, MAX_KILOBYTES,
> NULL, NULL, NULL
> },
>
> {
> {"max_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS,
> gettext_noop("Sets the WAL size that triggers a checkpoint."),
> NULL,
> GUC_UNIT_MB
> },
> &max_wal_size_mb,
> 64 * (XLOG_SEG_SIZE / (1024 * 1024)), 2, MAX_KILOBYTES,
> NULL, assign_max_wal_size, NULL
> },
>
> Hence I have retained the same calculation for min_wal_size and
> max_wal_size. If we get consensus for fixing a default and updating
> when required, then I will change the code accordingly.
So the question is whether we want {max,min}_wal_size be sized in
multiples of segment sizes or as a proper byte size. I'm leaning
towards the latter.
- Andres
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2017-08-30 00:49:14 | Re: segment size depending *_wal_size defaults (was increasing the default WAL segment size) |
Previous Message | Craig Ringer | 2017-08-30 00:36:00 | Re: [PATCH] Fix drop replication slot blocking instead of returning error |