Question about buffers_alloc in pg_stat_bgwriter view for monitoring

From: Alvar Freude <alvar(at)a-blast(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about buffers_alloc in pg_stat_bgwriter view for monitoring
Date: 2018-03-28 21:38:14
Message-ID: C261F12B-30B0-40A4-8A1E-3CE58B4E51C7@a-blast.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 amount of 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 reasonable checks (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/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cory Tucker 2018-03-28 21:49:16 Query Crashes PG 10.3 using partitions, works on 9.6
Previous Message David G. Johnston 2018-03-28 18:49:20 Using Lateral