Re: WAL directory size calculation - Mailing list pgsql-general

From Jeff Janes
Subject Re: WAL directory size calculation
Date
Msg-id CAMkU=1y+8y7Z2vFDCyjzBKpJHur5=AXXzvrsS6TkOX+RtJbTBg@mail.gmail.com
Whole thread Raw
In response to Re: WAL directory size calculation  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Thu, Jul 28, 2016 at 6:33 AM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> On Thu, Jul 28, 2016 at 9:25 AM, Moreno Andreo <moreno.andreo@evolu-s.it>
> wrote:
>>
>> I've read somewhere that the formula should be 16 MB * 3 *
>> checkpoint_segment in size.
>
> [...]
>
>>
>> Using the above formula I have:
>>     16 MB * 3 * 1 GB
>> that leads to to ... uh .. 48000 TB?
>
>
> You seem to be mis-remembering the formula.
>
> checkpoiint_segments is a quantity (i.e., unit-less), not a size.  Saying
> its "1GB" makes no sense.

Right, that doesn't make any sense.

> I'm also doubting you multiply it by 3 - add three to it maybe...

No, multiplying by 3 is roughly correct.  A log file can't be
recycled/removed until there have been 2 checkpoints started and
completed.   And if you have checkpoint completion target set to high
value, the 2nd checkpoint will complete just before the 3rd one will
be triggered to start.  So that means you have 3 * checkpoint_segments
worth of segment.

Cheers,

Jeff


pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: My Postgresql is inaccessible in Windows 8.1
Next
From: Jeff Janes
Date:
Subject: Re: WAL directory size calculation