Re: bgwrite process is too lazy

2024-10-06 Thread wenhui qiu
Hi Andres Freund Thank you for explanation > I doubt that slowdown is caused by bgwriter not being active enough. I suspect > what you're seeing is one or more of: > a) The overhead of doing full page writes (due to increasing the WAL > volume). You could verify whether that's the case by tur

Re: bgwrite process is too lazy

2024-10-04 Thread Andres Freund
Hi, On 2024-10-04 09:31:45 +0800, wenhui qiu wrote: > > It's implied, but to make it more explicit: One big efficiency advantage > of > > writes by checkpointer is that they are sorted and can often be combined > into > > larger writes. That's often a lot more efficient: For network attached > sto

Re: bgwrite process is too lazy

2024-10-03 Thread wenhui qiu
Hi Andres > It's implied, but to make it more explicit: One big efficiency advantage of > writes by checkpointer is that they are sorted and can often be combined into > larger writes. That's often a lot more efficient: For network attached storage > it saves you iops, for local SSDs it's much fr

Re: bgwrite process is too lazy

2024-10-03 Thread Andres Freund
Hi, On 2024-10-02 18:36:44 +0200, Tomas Vondra wrote: > On 10/2/24 17:02, Tony Wayne wrote: > > > > > > On Wed, Oct 2, 2024 at 8:14 PM Laurenz Albe > > wrote: > > > > On Wed, 2024-10-02 at 16:48 +0800, wenhui qiu wrote: > > > Whenever I check the checkp

Re: bgwrite process is too lazy

2024-10-02 Thread wenhui qiu
Hi Tomas Thank you for explaining,If do not change this static parameter,Can refer to the parameter autovacuum_vacuum_cost_delay and lower the minimum value of the bgwrite_delay parameter to 2ms? Let bgwrite write more dirty pages to reduce the impact on performance when checkpoint occurs?Af

Re: bgwrite process is too lazy

2024-10-02 Thread Tomas Vondra
On 10/2/24 17:02, Tony Wayne wrote: > > > On Wed, Oct 2, 2024 at 8:14 PM Laurenz Albe > 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 ch

Re: bgwrite process is too lazy

2024-10-02 Thread Tony Wayne
On Wed, Oct 2, 2024 at 8:14 PM Laurenz Albe 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 frequentl

Re: bgwrite process is too lazy

2024-10-02 Thread Laurenz Albe
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! Yours, Laurenz Albe