Skip to content

Latest commit

 

History

History
59 lines (27 loc) · 3.55 KB

20230518_01.md

File metadata and controls

59 lines (27 loc) · 3.55 KB

PostgreSQL 16 preview - Add writebacks & writeback_time to pg_stat_io

作者

digoal

日期

2023-05-18

标签

PostgreSQL , PolarDB , IO timing , checkpoint , writebacks , writeback_time , pg_stat_io


背景

《PostgreSQL 16 preview - Add IO timing for reads, writes, extends, and fsyncs to pg_stat_io as well.》

《PostgreSQL 16 preview - pg_stat_io 增加 hits, Track shared buffer hits》

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=093e5c57d506783a95dd8feddd9a3f2651e1aeba

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.

https://zhuanlan.zhihu.com/p/532262364

digoal's wechat