Re: incremental-checkopints - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: incremental-checkopints
Date
Msg-id CAEze2WhDb-i-qB+9NreCw6=Afsy9-mpxseQQfADYVML4+2cYUA@mail.gmail.com
Whole thread Raw
In response to Re: incremental-checkopints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: incremental-checkopints
List pgsql-hackers
On Wed, 26 Jul 2023 at 14:41, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> Hello
>
> On 2023-Jul-26, Thomas wen wrote:
>
> > Hi Hackes:   I found this page :
> > https://pgsql-hackers.postgresql.narkive.com/cMxBwq65/incremental-checkopints,PostgreSQL
> > no incremental checkpoints have been implemented so far. When a
> > checkpoint is triggered, the performance jitter of PostgreSQL is very
> > noticeable. I think incremental checkpoints should be implemented as
> > soon as possible
>
> I think my first question is why do you think that is necessary; there
> are probably other tools to achieve better performance.  For example,
> you may want to try making checkpoint_completion_target closer to 1, and
> the checkpoint interval longer (both checkpoint_timeout and
> max_wal_size).  Also, changing shared_buffers may improve things.  You
> can try adding more RAM to the machine.

Even with all those tuning options, a significant portion of a
checkpoint's IO (up to 50%) originates from FPIs in the WAL, which (in
general) will most often appear at the start of each checkpoint due to
each first update to a page after a checkpoint needing an FPI.
If instead we WAL-logged only the pages we are about to write to disk
(like MySQL's double-write buffer, but in WAL instead of a separate
cyclical buffer file), then a checkpoint_completion_target close to 1
would probably solve the issue, but with "WAL-logged torn page
protection at first update after checkpoint" we'll probably always
have higher-than-average FPI load just after a new checkpoint.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech/)



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: cataloguing NOT NULL constraints
Next
From: Aleksander Alekseev
Date:
Subject: Re: Remove unused fields in ReorderBufferTupleBuf