Re: Estimating wal_keep_size - Mailing list pgsql-performance

From Julien Rouhaud
Subject Re: Estimating wal_keep_size
Date
Msg-id 20210617010222.lho6zrgnkkkqyyxp@nol
Whole thread Raw
In response to Estimating wal_keep_size  ("Dean Gibson (DB Administrator)" <postgresql@mailpen.com>)
Responses Re: Estimating wal_keep_size
List pgsql-performance
On Wed, Jun 16, 2021 at 05:36:24PM -0700, Dean Gibson (DB Administrator) wrote:
> Is this reasonable thinking?
> 
> I'd think that one would want a *wal_keep_size* to cover the pending updates
> while the standby server might be unavailable, however long one might
> anticipate that would be.

It's usually a better approach to use a replication slot, to keep all the
required WAL files, and only when needed.  See
https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS
for more details.

Note that a replication slot will keep all WAL files, which might eventually
lead to an outage if the standby doesn't come back before the filesystem
containing the logs get full.  You can cap the maximum amount of retained WAL
filed since pg 13 using max_slot_wal_keep_size, see
https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE.



pgsql-performance by date:

Previous
From: "Dean Gibson (DB Administrator)"
Date:
Subject: Estimating wal_keep_size
Next
From: Michael Paquier
Date:
Subject: Re: PostgreSQL V13 Replication Issue