Re: PG12: Any drawback of increasing wal_keep_segments

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Shukla, Pranjal" <pshukla(at)akamai(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PG12: Any drawback of increasing wal_keep_segments
Date: 2022-03-29 15:17:29
Message-ID: 20220329151729.GN10577@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

* Alvaro Herrera (alvherre(at)alvh(dot)no-ip(dot)org) wrote:
> On 2022-Mar-22, Shukla, Pranjal wrote:
> > Are there any disadvantages of increasing the “wal_keep_segments” to a
> > higher number say, 500? Will it have any impact on performance of
> > streaming replication, on primary or secondary servers?
>
> No. It just means WAL will occupy more disk space. I've seen people go
> even as high as 5000 with no issues.

Yeah, though it makes the primary into essentially a WAL repository and,
really, you'd be better off having a dedicated repo that replicas can
pull from instead. Consider that a replica might fall way behind and
then demand the primary send 5000 WAL segments to it. The primary then
has to go pull that 80GB of data from disk and send it across the
network. As to if that's an issue or not depends on the IOPS and
bandwidth available, of course, but it's not free.

Thanks,

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philip Semanchuk 2022-03-29 18:05:44 Why is my function inlined only when STABLE?
Previous Message Saurav Sarkar 2022-03-29 15:12:21 Re: Indexes in JSONB