Re: max_wal_size

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: p(dot)luzanov(at)postgrespro(dot)ru
Cc: pluzanov(at)postgrespro(dot)ru, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: max_wal_size
Date: 2020-05-27 21:54:45
Message-ID: CAKFQuwY=eGGGe7E9xHkdR+8YnKXeA8xp-qfRMGFJrs-Hsb_D5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, May 27, 2020, 14:12 <p(dot)luzanov(at)postgrespro(dot)ru> wrote:

> David,
>
> > For 0.5 you get 2/3rds consumption: ( n / ( 1 + 0.5 ) ) = n * 2/3
>
> Exactly, for checkpoint_completion_target=0.5 the distance between
> checkpoints is 2/3 of max_wal_size.
>
> But back to the documentation of max_wal_size.
> "Maximum size to let the WAL grow to between automatic WAL checkpoints."
>
> For me it looks like the distance between checkpoints is equal to
> max_wal_size.
>
> English is not my native language, so I admit that I misunderstand the
> exact meaning of this phrase.
>
>
I think part of the issue is your operating with a mental model of this
contrary to the one the documentation was written for. Specifically if you
rely on a size trigger and set completion target to zero I believe you
should get something close to the full 10gb you are looking for. But there
is a reason why the wording for completion target uses the word "time" -
the mental model is that time is the typical driving factor and that the
size component is simply there to handle unusually high peak volume by
setting a ceiling that will indeed immediately trigger an automatic WAL
checkpoint.

In any case "grow to" means that it doesn't matter whether at the end of
the previous checkpoint 1gb or 9gb were in use - once the usage goes "up
to" 10gp the automatic checkpoint will trigger. If the word "to" wasn't
there your interpretation would be correct. Its a fair argument to say
such an important distinction shouldn't be placed on the word "to" but it
isn't wrong.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Thomas Munro 2020-05-27 23:43:45 Re: wal_init_zero and wal_recycle
Previous Message p.luzanov 2020-05-27 21:12:34 Re: max_wal_size