Re: Fwd: [BUG]: the walsender does not update its IO statistics until it exits
Xuneng Zhou <xunengzhou@gmail.com>
From: Xuneng Zhou <xunengzhou@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>,
Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>
Date: 2025-03-18T11:14:12Z
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. > >
Commits
-
Flush the IO statistics of active WAL senders more frequently
- e2a82cd23a88 16.9 landed
- 5cbbe70a9cc6 17.5 landed
- 039549d70f6a 18.0 landed
-
Optimize check for pending backend IO stats
- 6d3ea48ff1ae 18.0 landed