From ba5494becbdd9ee6c0b0eb7169fe0d09158f84f6 Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Wed, 15 Oct 2025 12:07:05 +0500 Subject: [PATCH] fix: Postgres | adjust postgres.conf params for smaller wal size + defaults --- postgres/index.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/postgres/index.ts b/postgres/index.ts index fa24caa..4d12bbd 100644 --- a/postgres/index.ts +++ b/postgres/index.ts @@ -330,6 +330,36 @@ export class PostgresCluster extends Construct { replicationTLSSecret: certNames.client, }, postgresql: { + parameters: { + archive_mode: "on", + archive_timeout: "5min", + checkpoint_timeout: "10min", + checkpoint_completion_target: "0.7", + dynamic_shared_memory_type: "posix", + full_page_writes: "on", + log_destination: "csvlog", + log_directory: "/controller/log", + log_filename: "postgres", + log_rotation_age: "0", + log_rotation_size: "0", + log_truncate_on_rotation: "false", + logging_collector: "on", + max_parallel_workers: "32", + max_replication_slots: "32", + max_wal_size: "768MB", + max_worker_processes: "32", + max_slot_wal_keep_size: "256MB", + min_wal_size: "128MB", + shared_memory_type: "mmap", + shared_preload_libraries: "", + ssl_max_protocol_version: "TLSv1.3", + ssl_min_protocol_version: "TLSv1.3", + wal_keep_size: "128MB", + wal_level: "logical", + wal_log_hints: "on", + wal_receiver_timeout: "5s", + wal_sender_timeout: "5s", + }, pg_hba: [ `hostssl all ${options.primaryUser} all cert`, "hostssl sameuser all all cert",