digoal
2023-05-18
PostgreSQL , PolarDB , IO timing , checkpoint , writebacks , writeback_time , pg_stat_io
《PostgreSQL 16 preview - pg_stat_io 增加 hits, Track shared buffer hits》
Add writebacks & writeback_time to pg_stat_io
28e626bde00 added the concept of IOOps but neglected to include writeback operations. ac8d53dae5 added time spent doing these I/O operations.
Without counting writeback, checkpointer write time in the log often differed substantially from that in pg_stat_io.
To fix this, add IOOp IOOP_WRITEBACK and track writeback in pg_stat_io.
writebacks: Number of units of size op_bytes which the process requested the kernel write out to permanent storage.
writeback_time: Time spent in writeback operations in milliseconds (if guc-track-io-timing is enabled, otherwise zero). This includes the time spent queueing write-out requests and, potentially, the time spent to write out the dirty data.