Question about buffers_alloc in pg_stat_bgwriter view for monitoring - Mailing list pgsql-general

From Alvar Freude
Subject Question about buffers_alloc in pg_stat_bgwriter view for monitoring
Date
Msg-id C261F12B-30B0-40A4-8A1E-3CE58B4E51C7@a-blast.org
Whole thread Raw
Responses Re: Question about buffers_alloc in pg_stat_bgwriter view formonitoring  ("Gunnar \"Nick\" Bluth" <gunnar.bluth@pro-open.de>)
List pgsql-general
Hi all,

Can someone tell me, what the value of buffers_alloc in the pg_stat_bgwriter view
(https://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-BGWRITER-VIEW)is exactly? Is this the
amountof shared buffers used by the bgwriter? 

I’m working on a new PostgreSQL monitoring framework (https://github.com/alvar-freude/Posemo) and now look how to make
reasonablechecks (and as result graphs) for BGWriter activity. 

At the moment my plan is to make more then one check out of pg_stat_bgwriter:

 * BGWriterAmount
   A check which returns the amount of written data,
   taken from the following values multiplied by
   current_setting('block_size'):
   buffers_checkpoint, buffers_clean, buffers_backend

 * BGWriterCheckpoints:
   A check which returns the number of checkpoints:
   checkpoints_timed + checkpoints_req
   Or: checkpoints_timed, checkpoints_req

 * BGWriterTime:
   Time taken by the BGWriter
   checkpoint_write_time, checkpoint_sync_time

 * BGWriterAlloc:
   Amount of memory used by BGWriter
   buffers_alloc * current_setting('block_size‘)

 * BGWriterInfo:
   Extra values, which should go to an extra graph, because they
   are much smaller and usually only increase in special situations
   maxwritten_clean, buffers_backend_fsync


Is this a reasonable plan to divide pg_stat_bgwriter into this parts?



Thanks && bye
  Alvar



--
Alvar C.H. Freude | http://alvar.a-blast.org/
https://blog.alvar-freude.de/
https://www.wen-waehlen.de/





Attachment

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Using Lateral
Next
From: Cory Tucker
Date:
Subject: Query Crashes PG 10.3 using partitions, works on 9.6