Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1SxL-0006Ab-Hq for pgsql-general@arkaria.postgresql.org; Thu, 29 Mar 2018 08:30:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f1SxK-0005xj-2c for pgsql-general@arkaria.postgresql.org; Thu, 29 Mar 2018 08:30:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1SxJ-0005xa-Qu for pgsql-general@lists.postgresql.org; Thu, 29 Mar 2018 08:30:45 +0000 Received: from pro-open.de ([87.106.136.39] helo=www.pro-open.de) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f1SxG-0006p0-PC for pgsql-general@lists.postgresql.org; Thu, 29 Mar 2018 08:30:45 +0000 Received: from [192.168.0.146] (aftr-37-201-243-218.unity-media.net [37.201.243.218]) by www.pro-open.de (Postfix) with ESMTP id E9A34100A0A6 for ; Thu, 29 Mar 2018 10:30:52 +0200 (CEST) Subject: Re: Question about buffers_alloc in pg_stat_bgwriter view for monitoring To: pgsql-general@lists.postgresql.org References: From: "Gunnar \"Nick\" Bluth" Openpgp: preference=signencrypt Message-ID: <1a00e942-e7c6-8e4d-afec-4b1befd5688d@pro-open.de> Date: Thu, 29 Mar 2018 10:30:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X7T9DAyr5DFm0i3nSYn1FCRr8lrKd5NhM" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --X7T9DAyr5DFm0i3nSYn1FCRr8lrKd5NhM Content-Type: multipart/mixed; boundary="hbPjVkH2tsPe7A4jLKa15Rvm7DRb6KYFK"; protected-headers="v1" From: "Gunnar \"Nick\" Bluth" To: pgsql-general@lists.postgresql.org Message-ID: <1a00e942-e7c6-8e4d-afec-4b1befd5688d@pro-open.de> Subject: Re: Question about buffers_alloc in pg_stat_bgwriter view for monitoring References: In-Reply-To: --hbPjVkH2tsPe7A4jLKa15Rvm7DRb6KYFK Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable Am 28.03.2018 um 23:38 schrieb Alvar Freude: > Hi all, >=20 > Can someone tell me, what the value of buffers_alloc in the pg_stat_bgw= riter view (https://www.postgresql.org/docs/current/static/monitoring-sta= ts.html#PG-STAT-BGWRITER-VIEW) is exactly? Is this the amount of shared b= uffers 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, --=20 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 --hbPjVkH2tsPe7A4jLKa15Rvm7DRb6KYFK-- --X7T9DAyr5DFm0i3nSYn1FCRr8lrKd5NhM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJavKQwAAoJEBAQrmsyiTOM+VYIAJJqS8vPDumCWuvS7tCMwzZZ kFb3i7FnvHE4Zv+GvfsVwHn5ZvROaSvZnWpYnpx7+zAHJFH+Ir62u9IFvUHU9wvT MtmFyk1492LPJa55j3YqwdB4e5DfeoTBdfxEt8FGMd5MoIll5D9iT4WQfDQ/fpMw /0JCNXI/AYT8aGY1XWprnN4aT+FjKDt/PDYoosljF94bfxR6Uf9v6G80kCE1Y4rR 0yFaRWQOZtSqptlHglSqPbkNasYFgCd8SqZKv1t+sKc9vtxoanUhCGDfJ4Tw4BJF Znq63PY0sQGsqf5fZREs50Rx+YujLksBH9mbpaXqTeSF1OO5pwQ4lFY6WFsxkMI= =sF2Y -----END PGP SIGNATURE----- --X7T9DAyr5DFm0i3nSYn1FCRr8lrKd5NhM--