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

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits
Date: 2025-03-18 11:14:12
Message-ID: CABPTF7XT=txv4-6SnpZGkx-CreWQ3UsOq2WCat1i64TNnuO=Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I performed some tests using elog(no so sure whether this is the proper way
to do it) to monitor the new method. Here are the findings:

• With PGSTAT_MIN_INTERVAL set to 1000ms, the number of flush reports was
reduced to approximately 40–50 during the installcheck test suite.

• With PGSTAT_IDLE_INTERVAL set to 10000ms, the reports dropped to fewer
than 5.

• In contrast, the previous approach—flushing after every
WalSndKeepaliveIfNecessary()—resulted in roughly 50,000 flushes.

This reduction is significant, so the overhead from the flush reports is no
longer a concern. However, we still need to determine whether this
frequency is sufficient to capture the system’s state during periods of
high WAL activity. Based on my tests, using PGSTAT_MIN_INTERVAL seems to
provide a better balance than PGSTAT_IDLE_INTERVAL.

>
> > > 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.
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2025-03-18 11:19:36 Re: Add semi-join pushdown to postgres_fdw
Previous Message Alexander Pyhalov 2025-03-18 11:13:56 Re: Add semi-join pushdown to postgres_fdw