Re: max_wal_size and wal_keep_size

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: max_wal_size and wal_keep_size
Date: 2022-08-30 17:29:17
Message-ID: d56da8fc92109960f24fb805e17d1be5fe5d0adb.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, 2022-08-30 at 08:29 +0000, James Pang (chaolpan) wrote:
> We want keep more wal to give more room for data replication, in case of some delay ,
> and need old wal data. So wan to set wal_keep_size , and want to increase
> max_wal-size a lot to make max_wal_size > wal_keep_size (it may > 1TB).

The two parameters are independent:
- "max_wal_size" does *not* determine the maximum WAL size, but how much
WAL can be produced before the next checkpoint is triggered.
- "wal_keep_size" determines how much old WAL is kept around.

Set "wal_keep_size" and leave "max_wal_size" unchanged.

Or even better, use a replication slot.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Teja Jakkidi 2022-08-30 21:21:50 Re: Performance issue after creating partitions
Previous Message hubert depesz lubaczewski 2022-08-30 16:20:03 Re: Two PostgreSQL instances returning different output for same query