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>,
Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>
Date: 2025-03-19T01:53:16Z
Lists: pgsql-hackers
Hi, I am OK with PGSTAT_MIN_INTERVAL. It has been used for flushing other statistics as well. And monitoring systems are generally configured to poll at one-second or longer intervals. > > I think that reporting at PGSTAT_MIN_INTERVAL is fine and more than > enough. I > mean, I 'm not sure that there is a real use case to query the statistics > related > view at more than a second interval anyway. I think these two conditions are good too. In a busy system, they are met frequently, so the flush routine will be executed at least once every second. Conversely, when WAL generation is low, there's simply less data to record, and the flush frequency naturally decreases. > Or are you concerned that we may not > enter the "When the WAL sender is caught up or has pending data to send" > frequently > enough? > > > Based on my tests, using PGSTAT_MIN_INTERVAL seems to > > provide a better balance than PGSTAT_IDLE_INTERVAL. > > Same here. > >
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