public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tomas Vondra <[email protected]>
To: Tony Wayne <[email protected]>
To: Laurenz Albe <[email protected]>
To: pgsql-hackers <[email protected]>
Subject: Re: bgwrite process is too lazy
Date: Wed, 2 Oct 2024 18:36:44 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAAW5B8yE4DD+5fTE9jQff7k8qyMJ9MNGMJTyNQt_PcRdfCXq7Q@mail.gmail.com>
References: <CAGjGUALHnmQFXmBYaFCupXQu7nx7HZ79xN29+HoE5s-USqprUg@mail.gmail.com>
<[email protected]>
<CAAW5B8yE4DD+5fTE9jQff7k8qyMJ9MNGMJTyNQt_PcRdfCXq7Q@mail.gmail.com>
On 10/2/24 17:02, Tony Wayne wrote:
>
>
> On Wed, Oct 2, 2024 at 8:14 PM Laurenz Albe <[email protected]
> <mailto:[email protected]>> wrote:
>
> On Wed, 2024-10-02 at 16:48 +0800, wenhui qiu wrote:
> > Whenever I check the checkpoint information in a log, most dirty
> pages are written by the checkpoint process
>
> That's exactly how it should be!
>
> is it because if bgwriter frequently flushes, the disk io will be more?🤔
Yes, pretty much. But it's also about where the writes happen.
Checkpoint flushes dirty buffers only once per checkpoint interval,
which is the lowest amount of write I/O that needs to happen.
Every other way of flushing buffers is less efficient, and is mostly a
sign of memory pressure (shared buffers not large enough for active part
of the data).
But it's also happens about where the writes happen. Checkpoint does
that in the background, not as part of regular query execution. What we
don't want is for the user backends to flush buffers, because it's
expensive and can cause result in much higher latency.
The bgwriter is somewhere in between - it's happens in the background,
but may not be as efficient as doing it in the checkpointer. Still much
better than having to do this in regular backends.
regards
--
Tomas Vondra
view thread (4+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: bgwrite process is too lazy
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox