Re: Setting wal_keep_segments parameter - Mailing list pgsql-general

From Tom Lane
Subject Re: Setting wal_keep_segments parameter
Date
Msg-id 543047.1620598992@sss.pgh.pa.us
Whole thread Raw
In response to Setting wal_keep_segments parameter  (rob stan <aslicokay@gmail.com>)
List pgsql-general
rob stan <aslicokay@gmail.com> writes:
> I want to set wal_keep_segments parameter to a value but what should be the
> process I follow? I have archiving process on all clusters is on but when a
> sudden process comes to postgres wal files will be bigger than i assume. I
> don't know what I should  do. Could you please help me?

Well, the thing about wal_keep_segments is that there is no guaranteed
safe value.  If you are trying to use it to protect streaming standby
servers then the better modern solution is to have the standbys use
replication slots, so the primary actually knows how much old WAL
they need.  On the other hand, if you're just concerned about archiving
then I don't think you need it at all; the archiving mechanism doesn't
need any help to ensure that WAL doesn't get recycled before it's
archived.

Or in short: I think the correct setting for wal_keep_segments is
zero.  There are generally better ways to do what it does.

            regards, tom lane



pgsql-general by date:

Previous
From: rob stan
Date:
Subject: Setting wal_keep_segments parameter
Next
From: Venkata B Nagothi
Date:
Subject: Re: Postgres upgrade 12 - issues with OIDs