Change default of checkpoint_completion_target

Lists: pgsql-hackers
From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Change default of checkpoint_completion_target
Date: 2020-12-07 17:53:29
Message-ID: 20201207175329.GM16415@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Michael Paquier (michael(at)paquier(dot)xyz) wrote:
> On Sun, Dec 06, 2020 at 10:03:08AM -0500, Stephen Frost wrote:
> > * Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
> >> You keep making this statement, and I don't necessarily disagree, but if
> >> that is the case, please explain why don't we have
> >> checkpoint_completion_target set to 0.9 by default? Should we change
> >> that?
> >
> > Yes, I do think we should change that..
>
> Agreed. FWIW, no idea for others, but it is one of those parameters I
> keep telling to update after a default installation.

Concretely, attached is a patch which changes the default and updates
the documentation accordingly.

Passes regression tests and doc build. Will register in the January
commitfest as Needs Review.

Thanks,

Stephen

Attachment Content-Type Size
cct_def_v1.patch text/x-diff 5.3 KB

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-07 19:08:25
Message-ID: 5285eb02-3340-7728-9f62-1a4365eda850@enterprisedb.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2020-12-07 18:53, Stephen Frost wrote:
> * Michael Paquier (michael(at)paquier(dot)xyz) wrote:
>> On Sun, Dec 06, 2020 at 10:03:08AM -0500, Stephen Frost wrote:
>>> * Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
>>>> You keep making this statement, and I don't necessarily disagree, but if
>>>> that is the case, please explain why don't we have
>>>> checkpoint_completion_target set to 0.9 by default? Should we change
>>>> that?
>>>
>>> Yes, I do think we should change that..
>>
>> Agreed. FWIW, no idea for others, but it is one of those parameters I
>> keep telling to update after a default installation.
>
> Concretely, attached is a patch which changes the default and updates
> the documentation accordingly.

I agree with considering this change, but I wonder why the value 0.9.
Why not, say, 0.95, 0.99, or 1.0?


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-07 19:17:43
Message-ID: 20201207191742.GN16415@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Peter Eisentraut (peter(dot)eisentraut(at)enterprisedb(dot)com) wrote:
> On 2020-12-07 18:53, Stephen Frost wrote:
> >* Michael Paquier (michael(at)paquier(dot)xyz) wrote:
> >>On Sun, Dec 06, 2020 at 10:03:08AM -0500, Stephen Frost wrote:
> >>>* Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
> >>>>You keep making this statement, and I don't necessarily disagree, but if
> >>>>that is the case, please explain why don't we have
> >>>>checkpoint_completion_target set to 0.9 by default? Should we change
> >>>>that?
> >>>
> >>>Yes, I do think we should change that..
> >>
> >>Agreed. FWIW, no idea for others, but it is one of those parameters I
> >>keep telling to update after a default installation.
> >
> >Concretely, attached is a patch which changes the default and updates
> >the documentation accordingly.
>
> I agree with considering this change, but I wonder why the value 0.9. Why
> not, say, 0.95, 0.99, or 1.0?

The documentation (which my patch updates to match the new default)
covers this pretty well here:

https://www.postgresql.org/docs/current/wal-configuration.html

"Although checkpoint_completion_target can be set as high as 1.0, it is
best to keep it less than that (perhaps 0.9 at most) since checkpoints
include some other activities besides writing dirty buffers. A setting
of 1.0 is quite likely to result in checkpoints not being completed on
time, which would result in performance loss due to unexpected variation
in the number of WAL segments needed."

Thanks,

Stephen


From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-08 17:29:30
Message-ID: 7CFCC359-5786-40DB-90A8-BDB0F08F2ABC@amazon.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 12/7/20, 9:53 AM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
> Concretely, attached is a patch which changes the default and updates
> the documentation accordingly.

+1 to setting checkpoint_completion_target to 0.9 by default.

Nathan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-08 17:41:35
Message-ID: 3258483.1607449295@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

"Bossart, Nathan" <bossartn(at)amazon(dot)com> writes:
> On 12/7/20, 9:53 AM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
>> Concretely, attached is a patch which changes the default and updates
>> the documentation accordingly.

> +1 to setting checkpoint_completion_target to 0.9 by default.

FWIW, I kind of like the idea of getting rid of it completely.
Is there really ever a good reason to set it to something different
than that? If not, well, we have too many GUCs already, and each
of them carries nonzero performance, documentation, and maintenance
overhead.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-08 17:47:34
Message-ID: CABUevEzYPRtrA1gPtT6d6XhevzK3wpmn-=1AqEq2HoysN1_MUg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 8, 2020 at 6:42 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Bossart, Nathan" <bossartn(at)amazon(dot)com> writes:
> > On 12/7/20, 9:53 AM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
> >> Concretely, attached is a patch which changes the default and updates
> >> the documentation accordingly.
>
> > +1 to setting checkpoint_completion_target to 0.9 by default.
>
> FWIW, I kind of like the idea of getting rid of it completely.
> Is there really ever a good reason to set it to something different
> than that? If not, well, we have too many GUCs already, and each
> of them carries nonzero performance, documentation, and maintenance
> overhead.
>

+1.

There are plenty of cases I think where it doesn't really matter with the
values, but when it does I'm not sure what it would be where something else
would actually be better.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>


From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-09 09:41:54
Message-ID: a074d3afe567e9b4b54e2cccfcd4b0b07790264d.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2020-12-08 at 17:29 +0000, Bossart, Nathan wrote:
> +1 to setting checkpoint_completion_target to 0.9 by default.

+1 for changing the default or getting rid of it, as Tom suggested.

While we are at it, could we change the default of "log_lock_waits" to "on"?

Yours,
Laurenz Albe


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-10 17:16:02
Message-ID: 20201210171602.GP16415@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Laurenz Albe (laurenz(dot)albe(at)cybertec(dot)at) wrote:
> On Tue, 2020-12-08 at 17:29 +0000, Bossart, Nathan wrote:
> > +1 to setting checkpoint_completion_target to 0.9 by default.
>
> +1 for changing the default or getting rid of it, as Tom suggested.

Attached is a patch to change it from a GUC to a compile-time #define
which is set to 0.9, with accompanying documentation updates.

> While we are at it, could we change the default of "log_lock_waits" to "on"?

While I agree that it'd be good to change quite a few of the log_X items
to be 'on' by default, I'm not planning to work on this.

Thanks,

Stephen

Attachment Content-Type Size
cct_def_v2.patch text/x-diff 13.0 KB

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-10 17:21:26
Message-ID: 20201210172126.GA25979@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Howdy,

On 2020-Dec-10, Stephen Frost wrote:

> * Laurenz Albe (laurenz(dot)albe(at)cybertec(dot)at) wrote:
> > On Tue, 2020-12-08 at 17:29 +0000, Bossart, Nathan wrote:
> > > +1 to setting checkpoint_completion_target to 0.9 by default.
> >
> > +1 for changing the default or getting rid of it, as Tom suggested.
>
> Attached is a patch to change it from a GUC to a compile-time #define
> which is set to 0.9, with accompanying documentation updates.

I think we should leave a doc stub or at least an <indexterm>, to let
people know the GUC has been removed rather than just making it
completely invisible. (Maybe piggyback on the stuff in [1]?)

[1] https://postgr.es/m/CAGRY4nyA=jmBNa4LVwgGO1GyO-RnFmfkesddpT_uO+3=mot8DA@mail.gmail.com


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2020-12-10 17:22:55
Message-ID: 20201210172255.GQ16415@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
> On 2020-Dec-10, Stephen Frost wrote:
> > * Laurenz Albe (laurenz(dot)albe(at)cybertec(dot)at) wrote:
> > > On Tue, 2020-12-08 at 17:29 +0000, Bossart, Nathan wrote:
> > > > +1 to setting checkpoint_completion_target to 0.9 by default.
> > >
> > > +1 for changing the default or getting rid of it, as Tom suggested.
> >
> > Attached is a patch to change it from a GUC to a compile-time #define
> > which is set to 0.9, with accompanying documentation updates.
>
> I think we should leave a doc stub or at least an <indexterm>, to let
> people know the GUC has been removed rather than just making it
> completely invisible. (Maybe piggyback on the stuff in [1]?)
>
> [1] https://postgr.es/m/CAGRY4nyA=jmBNa4LVwgGO1GyO-RnFmfkesddpT_uO+3=mot8DA@mail.gmail.com

Yes, I agree, and am involved in that thread as well- currently waiting
feedback from others about the proposed approach.

Getting a few more people looking at that thread and commenting on it
would really help us be able to move forward.

Thanks,

Stephen


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-13 22:10:38
Message-ID: 20210113221038.GG27507@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Stephen Frost (sfrost(at)snowman(dot)net) wrote:
> * Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
> > On 2020-Dec-10, Stephen Frost wrote:
> > > * Laurenz Albe (laurenz(dot)albe(at)cybertec(dot)at) wrote:
> > > > On Tue, 2020-12-08 at 17:29 +0000, Bossart, Nathan wrote:
> > > > > +1 to setting checkpoint_completion_target to 0.9 by default.
> > > >
> > > > +1 for changing the default or getting rid of it, as Tom suggested.
> > >
> > > Attached is a patch to change it from a GUC to a compile-time #define
> > > which is set to 0.9, with accompanying documentation updates.
> >
> > I think we should leave a doc stub or at least an <indexterm>, to let
> > people know the GUC has been removed rather than just making it
> > completely invisible. (Maybe piggyback on the stuff in [1]?)
> >
> > [1] https://postgr.es/m/CAGRY4nyA=jmBNa4LVwgGO1GyO-RnFmfkesddpT_uO+3=mot8DA@mail.gmail.com
>
> Yes, I agree, and am involved in that thread as well- currently waiting
> feedback from others about the proposed approach.

I've tried to push that forward. I'm happy to update this patch once
we've got agreement to move forward on that, to wit, adding to an
'obsolete' section in the documentation information about this
particular GUC and how it's been removed due to not being sensible or
necessary to continue to have.

> Getting a few more people looking at that thread and commenting on it
> would really help us be able to move forward.

This is still the case though..

Thanks!

Stephen


From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-14 05:48:23
Message-ID: X//bJ6HKQJWx1wxA@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 10, 2020 at 12:16:02PM -0500, Stephen Frost wrote:
> Attached is a patch to change it from a GUC to a compile-time #define
> which is set to 0.9, with accompanying documentation updates.

All the references to checkpoint_target_completion are removed (except
for bgwriter.h as per the patch).

> This is because it performs a checkpoint, and the I/O
> - required for the checkpoint will be spread out over a significant
> - period of time, by default half your inter-checkpoint interval
> - (see the configuration parameter
> - <xref linkend="guc-checkpoint-completion-target"/>). This is
> + required for the checkpoint will be spread out over the inter-checkpoint
> + interval (see the configuration parameter
> + <xref linkend="guc-checkpoint-timeout"/>). This is

It may be worth mentioning that this is spread across 90% of the last
checkpoint's duration instead.

> - in about half the time before the next checkpoint starts. On a system
> - that's very close to maximum I/O throughput during normal operation,
> - you might want to increase <varname>checkpoint_completion_target</varname>
> - to reduce the I/O load from checkpoints. The disadvantage of this is that
> - prolonging checkpoints affects recovery time, because more WAL segments
> - will need to be kept around for possible use in recovery. Although
> - <varname>checkpoint_completion_target</varname> can be set as high as 1.0,
> - it is best to keep it less than that (perhaps 0.9 at most) since
> - checkpoints include some other activities besides writing dirty buffers.
> - A setting of 1.0 is quite likely to result in checkpoints not being
> - completed on time, which would result in performance loss due to
> - unexpected variation in the number of WAL segments needed.
> + This spreads out the I/O as much as possible to have the I/O load be consistent
> + during the checkpoint and generally throughout the operation of the system. The
> + disadvantage of this is that prolonging checkpoints affects recovery time,
> + because more WAL segments will need to be kept around for possible use in recovery.
> + A user concerned about the amount of time required to recover might wish to reduce
> + <varname>checkpoint_timeout</varname>, causing checkpoints to happen more
> + frequently.
> </para>
>
> <para>

Again, this makes the description of the I/O spread more general,
removing the portion where half the time is used by default. Should
this stuff also mention the spread value of 90% instead?

> * At a checkpoint, how many WAL segments to recycle as preallocated future
> * XLOG segments? Returns the highest segment that should be preallocated.
> @@ -8694,7 +8687,7 @@ UpdateCheckPointDistanceEstimate(uint64 nbytes)
> * CHECKPOINT_IS_SHUTDOWN: checkpoint is for database shutdown.
> * CHECKPOINT_END_OF_RECOVERY: checkpoint is for end of WAL recovery.
> * CHECKPOINT_IMMEDIATE: finish the checkpoint ASAP,
> - * ignoring checkpoint_completion_target parameter.
> + * ignoring the CheckPointCompletionTarget.

s/the//?

> * be a large gap between a checkpoint's redo-pointer and the checkpoint
> * record itself, and we only start the restartpoint after we've seen the
> * checkpoint record. (The gap is typically up to CheckPointSegments *
> - * checkpoint_completion_target where checkpoint_completion_target is the
> + * CheckPointCompletionTarget where CheckPointCompletionTarget is the
> * value that was in effect when the WAL was generated).

The last part of this sentence does not make sense.
CheckPointCompletionTarget becomes a constant with this patch.

> if (RecoveryInProgress())
> @@ -903,7 +902,7 @@ CheckpointerShmemInit(void)
> * CHECKPOINT_IS_SHUTDOWN: checkpoint is for database shutdown.
> * CHECKPOINT_END_OF_RECOVERY: checkpoint is for end of WAL recovery.
> * CHECKPOINT_IMMEDIATE: finish the checkpoint ASAP,
> - * ignoring checkpoint_completion_target parameter.
> + * ignoring the CheckPointCompletionTarget.

s/the//?

> + * CheckPointCompletionTarget used to be exposed as a GUC named
> + * checkpoint_completion_target, but there's little evidence to suggest that
> + * there's actually a case for it being a different value, so it's no longer
> + * exposed as a GUC to be configured.

I would just remove this paragraph.
--
Michael


From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-15 21:51:56
Message-ID: 20210115215156.uuouk2u44gac6pts@alap3.anarazel.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2020-12-08 12:41:35 -0500, Tom Lane wrote:
> FWIW, I kind of like the idea of getting rid of it completely.
> Is there really ever a good reason to set it to something different
> than that? If not, well, we have too many GUCs already, and each
> of them carries nonzero performance, documentation, and maintenance
> overhead.

I like the idea of getting rid of it too, but I think we should consider
evaluating the concrete hard-coded value a bit more careful than just
going for 0.9 based on some old recommendations in the docs. It not
being changeable afterwards...

I think it might be a good idea to immediately change the default to
0.9, and concurrently try to evaluate whether it's really the best value
(vs 0.95, 1 or ...).

FWIW I have seen a few cases in the past where setting the target to
something very small helped, but I think that was mostly because we
didn't yet tell the kernel to flush dirty data more aggressively.

Greetings,

Andres Freund


From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-15 22:05:02
Message-ID: 9cbef4ca-807f-e65a-08bf-4f376aecea41@enterprisedb.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 1/15/21 10:51 PM, Andres Freund wrote:
> Hi,
>
> On 2020-12-08 12:41:35 -0500, Tom Lane wrote:
>> FWIW, I kind of like the idea of getting rid of it completely.
>> Is there really ever a good reason to set it to something different
>> than that? If not, well, we have too many GUCs already, and each
>> of them carries nonzero performance, documentation, and maintenance
>> overhead.
>
> I like the idea of getting rid of it too, but I think we should consider
> evaluating the concrete hard-coded value a bit more careful than just
> going for 0.9 based on some old recommendations in the docs. It not
> being changeable afterwards...
>
> I think it might be a good idea to immediately change the default to
> 0.9, and concurrently try to evaluate whether it's really the best value
> (vs 0.95, 1 or ...).
>
> FWIW I have seen a few cases in the past where setting the target to
> something very small helped, but I think that was mostly because we
> didn't yet tell the kernel to flush dirty data more aggressively.
>

Yeah. The flushing probably makes that mostly unnecessary, but we still
allow disabling that. I'm not really convinced replacing it with a
compile-time #define is a good idea, exactly because it can't be changed
if needed.

As for the exact value, maybe the right solution is to make it dynamic.
The usual approach is to leave "enough time" for the kernel to flush
dirty data, so we could say 60 seconds and calculate the exact target
depending on the checkpoint_timeout.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Andres Freund <andres(at)anarazel(dot)de>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-15 22:41:16
Message-ID: 20210115224116.ekcz5g7y6kbb5fmz@alap3.anarazel.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2021-01-15 23:05:02 +0100, Tomas Vondra wrote:
> Yeah. The flushing probably makes that mostly unnecessary, but we still
> allow disabling that. I'm not really convinced replacing it with a
> compile-time #define is a good idea, exactly because it can't be changed
> if needed.

It's also not available everywhere...

> As for the exact value, maybe the right solution is to make it dynamic.
> The usual approach is to leave "enough time" for the kernel to flush
> dirty data, so we could say 60 seconds and calculate the exact target
> depending on the checkpoint_timeout.

IME the kernel flushing at some later time precisely is the problem,
because of the latency spikes that happen when it decides to do so. That
commonly starts to happen well before the fsyncs. The reason that
setting a very small checkpoint_completion_target can help is that it
condenses the period of unrealiable performance into one short time,
rather than spreading it over the whole checkpoint...

Greetings,

Andres Freund


From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-19 08:21:15
Message-ID: ba8bb5e9-8c43-11b6-eb99-ae794cd37665@enterprisedb.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2021-01-13 23:10, Stephen Frost wrote:
>> Yes, I agree, and am involved in that thread as well- currently waiting
>> feedback from others about the proposed approach.
> I've tried to push that forward. I'm happy to update this patch once
> we've got agreement to move forward on that, to wit, adding to an
> 'obsolete' section in the documentation information about this
> particular GUC and how it's been removed due to not being sensible or
> necessary to continue to have.

Some discussion a few days ago was arguing that it was still necessary
in some cases as a way to counteract the possible lack of tuning in the
kernel flushing behavior. I think in light of that we should go with
your first patch that just changes the default, possibly with the
documentation updated a bit.


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-19 19:14:50
Message-ID: 20210119191450.GO27507@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Peter Eisentraut (peter(dot)eisentraut(at)enterprisedb(dot)com) wrote:
> On 2021-01-13 23:10, Stephen Frost wrote:
> >>Yes, I agree, and am involved in that thread as well- currently waiting
> >>feedback from others about the proposed approach.
> >I've tried to push that forward. I'm happy to update this patch once
> >we've got agreement to move forward on that, to wit, adding to an
> >'obsolete' section in the documentation information about this
> >particular GUC and how it's been removed due to not being sensible or
> >necessary to continue to have.
>
> Some discussion a few days ago was arguing that it was still necessary in
> some cases as a way to counteract the possible lack of tuning in the kernel
> flushing behavior. I think in light of that we should go with your first
> patch that just changes the default, possibly with the documentation updated
> a bit.

Rebased and updated patch attached which moves back to just changing the
default instead of removing the option, with a more explicit call-out of
the '90%', as suggested by Michael on the other patch.

Any further comments or thoughts on this one?

Thanks,

Stephen

Attachment Content-Type Size
cct_def_v3.patch text/x-diff 6.7 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-19 19:30:46
Message-ID: 519044.1611084646@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> Any further comments or thoughts on this one?

This:

+ total time between checkpoints. The default is 0.9, which spreads the
+ checkpoint across the entire checkpoint timeout period of time,

is confusing because 0.9 is obviously not 1.0; people will wonder
whether the scale is something strange or the text is just wrong.
They will also wonder why not use 1.0 instead. So perhaps more like

... The default is 0.9, which spreads the checkpoint across almost
all the available interval, providing fairly consistent I/O load
while also leaving some slop for checkpoint completion overhead.

The other chunk of text seems accurate, but there's no reason to let
this one be misleading.

regards, tom lane


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-19 19:47:48
Message-ID: 20210119194748.GP27507@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
> > Any further comments or thoughts on this one?
>
> This:
>
> + total time between checkpoints. The default is 0.9, which spreads the
> + checkpoint across the entire checkpoint timeout period of time,
>
> is confusing because 0.9 is obviously not 1.0; people will wonder
> whether the scale is something strange or the text is just wrong.
> They will also wonder why not use 1.0 instead. So perhaps more like
>
> ... The default is 0.9, which spreads the checkpoint across almost
> all the available interval, providing fairly consistent I/O load
> while also leaving some slop for checkpoint completion overhead.
>
> The other chunk of text seems accurate, but there's no reason to let
> this one be misleading.

Good point, updated along those lines.

In passing, I noticed that we have a lot of documentation like:

This parameter can only be set in the postgresql.conf file or on the
server command line.

... which hasn't been true since the introduction of ALTER SYSTEM. I
don't really think it's this patch's job to clean that up but it doesn't
seem quite right that we don't include ALTER SYSTEM in that list either.
If this was C code, maybe we could get away with just changing such
references as we find them, but I don't think we'd want the
documentation to be in an inconsistent state regarding that.

Anyone want to opine about what to do with that? Should we consider
changing those to mention ALTER SYSTEM? Or perhaps have a way of saying
"at server start" that then links to "how to set options at server
start", perhaps..

Thanks,

Stephen

Attachment Content-Type Size
cct_def_v4.patch text/x-diff 6.9 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-19 20:12:34
Message-ID: 520756.1611087154@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> In passing, I noticed that we have a lot of documentation like:

> This parameter can only be set in the postgresql.conf file or on the
> server command line.

> ... which hasn't been true since the introduction of ALTER SYSTEM.

Well, it's still true if you understand "the postgresql.conf file"
to cover whatever's included by postgresql.conf, notably
postgresql.auto.conf (and the include facility existed long before
that, too, so you needed the expanded interpretation even then).
Still, I take your point that it's confusing.

I like your suggestion of shortening all of these to be "can only be set
at server start", or maybe better "cannot be changed after server start".
I'm not sure whether or not we really need new text elsewhere; I think
section 20.1 is pretty long already.

regards, tom lane


From: japin <japinli(at)hotmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-01-20 02:59:27
Message-ID: MEYP282MB1669B98B5AEBED6A460B62B7B6A20@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers


On Wed, 20 Jan 2021 at 03:47, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Greetings,
>
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> Stephen Frost <sfrost(at)snowman(dot)net> writes:
>> > Any further comments or thoughts on this one?
>>
>> This:
>>
>> + total time between checkpoints. The default is 0.9, which spreads the
>> + checkpoint across the entire checkpoint timeout period of time,
>>
>> is confusing because 0.9 is obviously not 1.0; people will wonder
>> whether the scale is something strange or the text is just wrong.
>> They will also wonder why not use 1.0 instead. So perhaps more like
>>
>> ... The default is 0.9, which spreads the checkpoint across almost
>> all the available interval, providing fairly consistent I/O load
>> while also leaving some slop for checkpoint completion overhead.
>>
>> The other chunk of text seems accurate, but there's no reason to let
>> this one be misleading.
>
> Good point, updated along those lines.
>
> In passing, I noticed that we have a lot of documentation like:
>
> This parameter can only be set in the postgresql.conf file or on the
> server command line.
>
> ... which hasn't been true since the introduction of ALTER SYSTEM. I
> don't really think it's this patch's job to clean that up but it doesn't
> seem quite right that we don't include ALTER SYSTEM in that list either.
> If this was C code, maybe we could get away with just changing such
> references as we find them, but I don't think we'd want the
> documentation to be in an inconsistent state regarding that.
>

I have already mentioned this in [1], however it seems unattractive.

[1] - https://www.postgresql.org/message-id/flat/199703E4-A795-4FB8-911C-D0DE9F51519C%40hotmail.com

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.


From: David Steele <david(at)pgmasters(dot)net>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-19 16:09:05
Message-ID: c564d4d9-27cc-0a7b-9d98-adf65fe9e825@pgmasters.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 1/19/21 2:47 PM, Stephen Frost wrote:
>
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> Stephen Frost <sfrost(at)snowman(dot)net> writes:
>>> Any further comments or thoughts on this one?
>>
>> This:
>>
>> + total time between checkpoints. The default is 0.9, which spreads the
>> + checkpoint across the entire checkpoint timeout period of time,
>>
>> is confusing because 0.9 is obviously not 1.0; people will wonder
>> whether the scale is something strange or the text is just wrong.
>> They will also wonder why not use 1.0 instead. So perhaps more like
>>
>> ... The default is 0.9, which spreads the checkpoint across almost
>> all the available interval, providing fairly consistent I/O load
>> while also leaving some slop for checkpoint completion overhead.
>>
>> The other chunk of text seems accurate, but there's no reason to let
>> this one be misleading.
>
> Good point, updated along those lines.

I had a look at the patch and the change and new documentation seem
sensible to me.

I think this phrase may be a bit too idiomatic:

+ consistent I/O load while also leaving some slop for checkpoint

Perhaps just:

+ consistent I/O load while also leaving some time for checkpoint

It seems to me that the discussion about changing the wording for GUCs
not changeable after server should be saved for another patch as long as
this patch follows the current convention.

Regards,
--
-David
david(at)pgmasters(dot)net


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-22 17:11:00
Message-ID: 20210322171059.GB20766@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* David Steele (david(at)pgmasters(dot)net) wrote:
> I had a look at the patch and the change and new documentation seem sensible
> to me.

Thanks!

> I think this phrase may be a bit too idiomatic:
>
> + consistent I/O load while also leaving some slop for checkpoint
>
> Perhaps just:
>
> + consistent I/O load while also leaving some time for checkpoint

Yeah, good thought, updated.

> It seems to me that the discussion about changing the wording for GUCs not
> changeable after server should be saved for another patch as long as this
> patch follows the current convention.

Agreed.

Unless there's anything further on this, I'll plan to commit it tomorrow
or Wednesday.

Thanks!

Stephen

Attachment Content-Type Size
cct_def_v5.patch text/x-diff 6.9 KB

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 05:31:30
Message-ID: YFl9MuiWf6iBbj1W@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Mar 22, 2021 at 01:11:00PM -0400, Stephen Frost wrote:
> Unless there's anything further on this, I'll plan to commit it tomorrow
> or Wednesday.

Cool, looks fine to me.

This version of the patch has forgotten to update one spot:
src/backend/postmaster/checkpointer.c:double CheckPointCompletionTarget = 0.5;
--
Michael


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 16:24:46
Message-ID: 20210323162446.GL20766@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Michael Paquier (michael(at)paquier(dot)xyz) wrote:
> On Mon, Mar 22, 2021 at 01:11:00PM -0400, Stephen Frost wrote:
> > Unless there's anything further on this, I'll plan to commit it tomorrow
> > or Wednesday.
>
> Cool, looks fine to me.
>
> This version of the patch has forgotten to update one spot:
> src/backend/postmaster/checkpointer.c:double CheckPointCompletionTarget = 0.5;

Hah! Indeed!

Fixed in the attached.

Thanks!

Stephen

Attachment Content-Type Size
cct_def_v6.patch text/x-diff 7.4 KB

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 18:24:07
Message-ID: E4F12190-A523-447B-BC35-E868CA5796F4@amazon.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

LGTM. I just have a few small wording suggestions.

+ completion overhead. Reducing this parameter is not recommended as that
+ causes the I/O from the checkpoint to have to complete faster, resulting
+ in a higher I/O rate, while then having a period of less I/O between the
+ completion of the checkpoint and the start of the next scheduled
+ checkpoint. This parameter can only be set in the

Reducing this parameter is not recommended because it forces the
checkpoint to complete faster. This results in a higher rate of I/O
during the checkpoint followed by a period of less I/O between
checkpoint completion and the next scheduled checkpoint.

+ duration). This spreads out the I/O as much as possible to have the I/O load be
+ consistent during the checkpoint. The disadvantage of this is that prolonging

This spreads out the I/O as much as possible so that the checkpoint
I/O load is consistent throughout the checkpoint interval.

+ around for possible use in recovery. A user concerned about the amount of time
+ required to recover might wish to reduce <varname>checkpoint_timeout</varname>,
+ causing checkpoints to happen more frequently while still spreading out the I/O
+ from each checkpoint. Alternatively,

A user concerned about the amount of time required to recover might
wish to reduce checkpoint_timeout so that checkpoints occur more
frequently but still spread the I/O across the checkpoint interval.

+ Although <varname>checkpoint_completion_target</varname> could be set as high as
+ 1.0, it is best to keep it less than that (such as at the default of 0.9, at most)
+ since checkpoints include some other activities besides writing dirty buffers.

Although checkpoint_completion_target can be set as high at 1.0, it is
typically recommended to set it to no higher than 0.9 (the default)
since checkpoints include some other activities besides writing dirty
buffers.

Nathan


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 18:30:33
Message-ID: 20210323183033.GI579@momjian.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Mar 23, 2021 at 06:24:07PM +0000, Bossart, Nathan wrote:
> LGTM. I just have a few small wording suggestions.
>
> + completion overhead. Reducing this parameter is not recommended as that
> + causes the I/O from the checkpoint to have to complete faster, resulting
> + in a higher I/O rate, while then having a period of less I/O between the
> + completion of the checkpoint and the start of the next scheduled
> + checkpoint. This parameter can only be set in the
>
> Reducing this parameter is not recommended because it forces the
> checkpoint to complete faster. This results in a higher rate of I/O
> during the checkpoint followed by a period of less I/O between
> checkpoint completion and the next scheduled checkpoint.

FYI, I am very happy this issue is being addressed for PG 14. :-)

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 19:19:06
Message-ID: 20210323191906.GO20766@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> LGTM. I just have a few small wording suggestions.

Agreed, those looked like good suggestions and so I've incorporated
them.

Updated patch attached.

Thanks!

Stephen

Attachment Content-Type Size
cct_def_v7.patch text/x-diff 7.4 KB

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-23 22:52:32
Message-ID: AD836E32-B4E8-47DE-B787-35BF01045F0B@amazon.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 3/23/21, 12:19 PM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
> * Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> > LGTM. I just have a few small wording suggestions.
>
> Agreed, those looked like good suggestions and so I've incorporated
> them.
>
> Updated patch attached.

Looks good!

Nathan


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Change default of checkpoint_completion_target
Date: 2021-03-24 17:09:04
Message-ID: 20210324170904.GT20766@tamriel.snowman.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Greetings,

* Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> On 3/23/21, 12:19 PM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
> > * Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> > > LGTM. I just have a few small wording suggestions.
> >
> > Agreed, those looked like good suggestions and so I've incorporated
> > them.
> >
> > Updated patch attached.
>
> Looks good!

Great, pushed! Thanks to everyone for your thoughts, comments,
suggestions, and improvments.

Stephen