Re: max_wal_size

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: max_wal_size
Дата
Msg-id CAKFQuwY=eGGGe7E9xHkdR+8YnKXeA8xp-qfRMGFJrs-Hsb_D5Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: max_wal_size  (p.luzanov@postgrespro.ru)
Ответы Re: max_wal_size  (p.luzanov@postgrespro.ru)
Список pgsql-docs
On Wed, May 27, 2020, 14:12 <p.luzanov@postgrespro.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.

В списке pgsql-docs по дате отправления:

Предыдущее
От: p.luzanov@postgrespro.ru
Дата:
Сообщение: Re: max_wal_size
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: wal_init_zero and wal_recycle