pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Dawn Yu <boyyuxiao1987@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: A Question about FPW and WAL
Date: Mon, 03 Apr 2023 11:38:30 +0200
Message-ID: <942e247261151cddf5d57cf7797d6bf3c9b067a7.camel@cybertec.at> (raw)
In-Reply-To: <CALiuKDHL-5h4DWYKiCXpQHJ8UHEG7mKj38eJVGWeT=nf604bLQ@mail.gmail.com>
References: <CALiuKDHL-5h4DWYKiCXpQHJ8UHEG7mKj38eJVGWeT=nf604bLQ@mail.gmail.com>

On Mon, 2023-04-03 at 14:51 +0800, Dawn Yu wrote:
> Recently,we come up with a same problem,when the database make the checkpoint,
> the size of wal directory increase very fast and  take one hundred percent disk
> usage,we found the problem of pg wal write amplification is very serious.
> By analyzing the wal log, in some scenarios, most of the space is wasted when
> maintaining the full page of the index. Has the community considered modifying
> this part of the relevant code to make the full page better,The setting of FPW
> function is divided into two parts, the full-page write of the data record and
> the full-page write of the index block, and the switch functions can be set
> separately.
> By default, index full-page write is disabled. If the index is broken, you can
> rebuild the index to solve it. Although the security of index data cannot be
> guaranteed, this setting can greatly reduce the problem of storage space explosion
> caused by wal write amplification.

I would feel funny about a parameter like that.

There are a couple of things you can do today:

- increase "max_wal_size" and "checkpoint_timeout" to get checkpoints less often

- activate "wal_compression", so that the FPW are compressed.  Best is to use v15,
  where you can use "lz4" or "zstd" compression, which are much faster.

Yours,
Laurenz Albe





view thread (4+ messages)  latest in thread

Message-ID: <942e247261151cddf5d57cf7797d6bf3c9b067a7.camel@cybertec.at>
Permalink:  ../942e247261151cddf5d57cf7797d6bf3c9b067a7.camel@cybertec.at/
Also on:    postgresql.org/message-id/942e247261151cddf5d57cf7797d6bf3c9b067a7.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, boyyuxiao1987@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: A Question about FPW and WAL
  In-Reply-To: <942e247261151cddf5d57cf7797d6bf3c9b067a7.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox