From: Gunnar \"Nick\" Bluth <gunnar.bluth@pro-open.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Question about buffers_alloc in pg_stat_bgwriter view for monitoring
Date: Thu, 29 Mar 2018 10:30:34 +0200
Message-ID: <1a00e942-e7c6-8e4d-afec-4b1befd5688d@pro-open.de> (raw)
In-Reply-To: <C261F12B-30B0-40A4-8A1E-3CE58B4E51C7@a-blast.org>
References: <C261F12B-30B0-40A4-8A1E-3CE58B4E51C7@a-blast.org>
Am 28.03.2018 um 23:38 schrieb Alvar Freude:
> 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?
As I had to research that anyway, there's no reason not to write this
down here as well... (probably simplified, but I'm quite confident the
information is correct ;-):
Whenever a buffer is allocated, a global counter is incremented (see
"StrategyGetBuffer" in storage/buffer/freelist.c. That counter is used
by the BGWriter to determine its own wakeup/hibernate strategy, and
on-the-fly written to the global stats.
Thus, buffer_alloc is the global count of buffers allocated in the
cluster. That it appears in the bgwriter statistics is more or less
coincidental.
Best regards,
--
Gunnar "Nick" Bluth
RHCE/SCLA
Mobil +49 172 8853339
Email: gunnar.bluth@pro-open.de
_____________________________________________________________
In 1984 mainstream users were choosing VMS over UNIX.
Ten years later they are choosing Windows over UNIX.
What part of that message aren't you getting? - Tom Payne
Attachments:
signature.asc (application/pgp-signature, 472B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: gunnar.bluth@pro-open.de
Subject: Re: Question about buffers_alloc in pg_stat_bgwriter view for monitoring
In-Reply-To: <1a00e942-e7c6-8e4d-afec-4b1befd5688d@pro-open.de>
References: <C261F12B-30B0-40A4-8A1E-3CE58B4E51C7@a-blast.org> <1a00e942-e7c6-8e4d-afec-4b1befd5688d@pro-open.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox