Re: Postgres Parameters

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Postgres Parameters
Дата
Msg-id CANzqJaD=bBAB95_gPGN4w+CfSkqiMv=qQL-WGPLmd6v4027iCg@mail.gmail.com
обсуждение исходный текст
Ответ на Postgres Parameters  (Sam Stearns <sam.stearns@dat.com>)
Список pgsql-admin
On Mon, Nov 10, 2025 at 6:28 PM Sam Stearns <sam.stearns@dat.com> wrote:
Howdy,

Could someone advise on how to determine the correct settings for the following, please?:
 

  • checkpoint_timeout
  • max_wal_size

How busy are your systems?

I sometimes set max_wal_size to be 6GB or 12GB, and sometimes the default.  As https://www.postgresql.org/docs/17/runtime-config-wal.html#GUC-MAX-WAL-SIZE says, "This is a soft limit; WAL size can exceed max_wal_size under special circumstances, such as heavy load".  Leave it at the default, and then search the log files for complaints about checkpointing too often.  No complaints?  Leave at the default.  Complaints?  Bump it up.

My standard checkpoint_timeout is 15 minutes, for Unremembered Reasons.  Things work, so I have no need to change.

If the disk with our WAL files crashes (not very likely), we probably lose at most 15 minutes of data.

When doing a multi-TB pg_restore to an empty database, I bump checkpoint_time to 30m and max_wal_size to 32GB (and use dangerous settings like fsync=off).

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

В списке pgsql-admin по дате отправления: