public inbox for [email protected]
help / color / mirror / Atom feedFrom: Robert Haas <[email protected]>
To: Jürgen Purtz <[email protected]>
Cc: Justin Pryzby <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Corey Huinker <[email protected]>
Cc: Roger Harkavy <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Fabien COELHO <[email protected]>
Cc: Michael Paquier <[email protected]>
Subject: Re: Add A Glossary
Date: Tue, 24 Mar 2020 15:58:40 -0400
Message-ID: <CA+TgmoYDHKdye3JcU5pd-yRhLL+Ee5qZiCmLEfU2Zu0NmgWPuw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CADkLM=fwtE-TCU7sRnvaE74z12kOp_A+CdUwMr7aZt39pXbh6A@mail.gmail.com>
<[email protected]>
<[email protected]>
<CA+TgmoYT2NnUueP5_=Z48XwVpyzciBfNxuuvYKUtLh-korZEmg@mail.gmail.com>
<[email protected]>
On Tue, Mar 24, 2020 at 3:40 PM Jürgen Purtz <[email protected]> wrote:
> On 24.03.20 19:46, Robert Haas wrote:
> Do we use shared_buffers for WAL ?
>
> No.
>
> What's about the explanation in https://www.postgresql.org/docs/12/runtime-config-wal.html : "wal_buffers (integer) The amount of shared memory used for WAL data that has not yet been written to disk. The default setting of -1 selects a size equal to 1/32nd (about 3%) of shared_buffers, ... " ? My understanding was, that the parameter wal_buffers grabs some of the existing shared_buffers for its own purpose. Is this a misinterpretation? Are shared_buffers and wal_buffers two different shared memory areas?
Yes. The code adds up the shared memory requests from all of the
different subsystems and then allocates one giant chunk of shared
memory which is divided up between them. The overwhelming majority of
that memory goes into shared_buffers, but not all of it. You can use
the new pg_get_shmem_allocations() function to see how it's used. For
example, with shared_buffers=4GB:
rhaas=# select name, pg_size_pretty(size) from
pg_get_shmem_allocations() order by size desc limit 10;
name | pg_size_pretty
----------------------+----------------
Buffer Blocks | 4096 MB
Buffer Descriptors | 32 MB
<anonymous> | 32 MB
XLOG Ctl | 16 MB
Buffer IO Locks | 16 MB
Checkpointer Data | 12 MB
Checkpoint BufferIds | 10 MB
clog | 2067 kB
| 1876 kB
subtrans | 261 kB
(10 rows)
rhaas=# select count(*), pg_size_pretty(sum(size)) from
pg_get_shmem_allocations();
count | pg_size_pretty
-------+----------------
54 | 4219 MB
(1 row)
So, in this configuration, there whole shared memory segment is
4219MB, of which 4096MB is allocated to shared_buffers and the rest to
dozens of smaller allocations, with 1876 kB left over that might get
snapped up later by an extension that wants some shared memory.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
view thread (97+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Add A Glossary
In-Reply-To: <CA+TgmoYDHKdye3JcU5pd-yRhLL+Ee5qZiCmLEfU2Zu0NmgWPuw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox