Re: WAL directory size calculation

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Moreno Andreo <moreno(dot)andreo(at)evolu-s(dot)it>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: WAL directory size calculation
Date: 2016-08-03 15:49:49
Message-ID: CAMkU=1y+8y7Z2vFDCyjzBKpJHur5=AXXzvrsS6TkOX+RtJbTBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jul 28, 2016 at 6:33 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Thu, Jul 28, 2016 at 9:25 AM, Moreno Andreo <moreno(dot)andreo(at)evolu-s(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2016-08-03 16:01:15 Re: WAL directory size calculation
Previous Message Melvin Davidson 2016-08-03 15:47:26 Re: My Postgresql is inaccessible in Windows 8.1