From 335feca441b338f796e205f0e227b2f3a43f130e Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 30 Mar 2007 18:34:56 +0000 Subject: Add some instrumentation to the bgwriter, through the stats collector. New view pg_stat_bgwriter, and the functions required to build it. --- doc/src/sgml/monitoring.sgml | 77 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 6e57a83df88..58ec5d3fc42 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1,4 +1,4 @@ - + Monitoring Database Activity @@ -260,6 +260,16 @@ postgres: user database host + + pg_stat_bgwriter + One row only, showing cluster-wide statistics from the + background writer: number of scheduled checkpoints, requested + checkpoints, buffers written by checkpoints, lru-scans and all-scans, + and the number of times the bgwriter aborted a round because it had + written too many buffers during lru-scans and all-scans. + + + pg_stat_database One row per database, showing database OID, database name, @@ -751,6 +761,71 @@ postgres: user database host + + pg_stat_get_bgwriter_timed_checkpoints() + bigint + + The number of times the bgwriter has started timed checkpoints + (because the checkpoint_timeout time has expired). + + + + + pg_stat_get_bgwriter_requested_checkpoints() + bigint + + The number of times the bgwriter has started checkpoints based on + requests from backends because the checkpoint_segments + has been exceeded or because the CHECKPOINT command has been issued. + + + + + pg_stat_get_bgwriter_buf_written_checkpoints() + bigint + + The number of buffers written by the bgwriter during checkpoints. + + + + + pg_stat_get_bgwriter_buf_written_lru() + bigint + + The number of buffers written by the bgwriter when performing a + LRU scan of the buffer cache. + + + + + pg_stat_get_bgwriter_buf_written_all() + bigint + + The number of buffers written by the bgwriter when performing a + scan of all the buffer cache. + + + + + pg_stat_get_bgwriter_maxwritten_lru() + bigint + + The number of times the bgwriter has stopped its LRU round because + it has written more buffers than specified in the + bgwriter_lru_maxpages parameter. + + + + + pg_stat_get_bgwriter_maxwritten_all() + bigint + + The number of times the bgwriter has stopped its all-buffer round + because it has written more buffers than specified in the + bgwriter_all_maxpages parameter. + + + pg_stat_clear_snapshot() void -- cgit v1.2.3