Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits
Date: 2025-03-13 13:19:51
Message-ID: Z9Lbd9BPogBFlLOX@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Mar 13, 2025 at 07:35:24PM +0800, Xuneng Zhou wrote:
> Hi,
> Given that PGSTAT_MIN_INTERVAL is the go-to setting for stats flushes
> * Unless called with 'force', pending stats updates are flushed happen once
> * per PGSTAT_MIN_INTERVAL (1000ms). When not forced, stats flushes do not
> * block on lock acquisition, except if stats updates have been pending for
> * longer than PGSTAT_MAX_INTERVAL (60000ms).
> *
> * Whenever pending stats updates remain at the end of pgstat_report_stat()
> a
> * suggested idle timeout is returned. Currently this is always
> * PGSTAT_IDLE_INTERVAL (10000ms). Callers can use the returned time to set
> up
> * a timeout after which to call pgstat_report_stat(true), but are not
> * required to do so.
>
> I am curious about the reason for this:

Thanks for looking at it!

> > 1. maybe relying on PGSTAT_IDLE_INTERVAL would make more sense? In both
> > case
> > PGSTAT_MIN_INTERVAL or PGSTAT_MIN_INTERVAL, I'm not sure there is a need to
> > update the related doc.
> >
> >
> PGSTAT_IDLE_INTERVAL seems to reduce the frequency even more.

Yeah, I think that PGSTAT_MIN_INTERVAL is the one to use (that's why that's the
one the patch is using). I just mentioned PGSTAT_IDLE_INTERVAL as an open door
for conversation in case one prefers a "larger" frequency.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2025-03-13 13:21:18 Re: Missing constraint when duplicated unique index ?
Previous Message Bertrand Drouvot 2025-03-13 13:18:45 Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits