Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVvFL-009kEr-0B for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:23:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVvFJ-00F9Lo-3C for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:23:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVvFJ-00F9Lg-1z for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 17:23:30 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVvFI-001GhD-0U for pgsql-general@postgresql.org; Wed, 17 Dec 2025 17:23:30 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-65cfc0cbaa7so136965eaf.2 for ; Wed, 17 Dec 2025 09:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765992206; x=1766597006; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=wFN7s0ranWPLb/k6QEAq6bOwaGO/e55lWUzb5ijACuU=; b=OKSIjXOugTir7bl0RhjcFqtcH7OyCWKtrDOYV7M6e5x+0Yg7xQBjhuKkESt8jMjypc cMsyXJhHKtRnG9t71eFEAsA1Lio+e1bAfcGUNuFpTjtSlWBEiRwXNucpvX0ymYkcUGGc Pk0AhbZRYwf8vHjXnboM/EMXs5quf5VveuF0d89NhZFQFzQdQ9CZKgV0pFSSABm9JfkZ 4Jp5vez/GLDj82i0KTVkQoG8wBgLsLUcl/LQ9d+9uDFtA12OmLNEDjRlXxzJAFpGRpI9 uihbFrOhy9zv4DFB7zo3EoJliJObDPY2RcywlnRv0QLkBuHt4akSm5UI7LzTIvTJvgq3 V8SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765992206; x=1766597006; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wFN7s0ranWPLb/k6QEAq6bOwaGO/e55lWUzb5ijACuU=; b=clfQrRs/6X1ZVMBcfk+O3X61mJwJktKiVpIFEv4VK3ZUi8UOIuPPKiovwUXP+WJVVf kKD0zwCaG48777idPDOBplXKRG3PrciPyQ21guQnCCD3XbPOHC0lI8CYAjt6YO2l7OaN tqxh1Mn/AVLeTPGsTJzyBkJ5SB431CVGywgh4S80lnvEgcpa8WbfmGpSbcBZBe19dnZN izWEISgx6ijVizUOdXG6q7kD7UAb8Hqoj3iycgh5mn7+KrjQ43+FNNZEFMQMgDPaGviY P3qdMCOdDpslK85AJlRkXRMbBlABcAJHScJRnF6Y7kHyzLPWkj0HrsZngjdPvzWEa5ID 2cEA== X-Gm-Message-State: AOJu0Yxyzf7M+6RDpK93SDgC6fFgXPz+6gQjpAsWf5DCgPCtJWnNXQMc V5BvYuRIuW66si5O7e9YPdohsgM544iYARN+OeBlJArDw8ciU4oaePyWc05tAG4LosbOPYCHUGX yghZ2/DA8x6QMevIbJdxW7sQEbZK/C6zRsVBX X-Gm-Gg: AY/fxX4pNMT9HJ0kKqOrYb47rijejwk0QhV/IvU1DRRjUoUB20qXnTwJRCVFu0BgaCh 9KB9x86rrQwDlTah0ZLnXfg104pk4Zel0dNeJW8v2ajxL57UBEhEzRwv0va56FQfmV+0RAEJTC+ z86dLGvOmODMRwJi7b4VeGa3WTuiFu7KbVjIiCf+ohdZYU3XIeEOFP8TGud2v6XBPQsCHKLEdaI K0PiynF+a7T3/bMmSIye+1yOrUksSNfdESUgvQuv8BX/GMaCfKF23ehI3Zb0UwT/f4XCRMe X-Google-Smtp-Source: AGHT+IHLOmsahvnVMEDEZWdN+saTSn9xCbufG2bKK27j2aYTdhU2CJC7PQM2AI/+kbeB7GUnwFmbYZdnQEVtTUygq3Q= X-Received: by 2002:a05:6820:998:b0:65b:380a:ce95 with SMTP id 006d021491bc7-65b4527fa1amr9258784eaf.62.1765992206426; Wed, 17 Dec 2025 09:23:26 -0800 (PST) MIME-Version: 1.0 References: <2a301859ab47c2e83ba5c8ebf75112d61246a8cd.camel@cybertec.at> In-Reply-To: From: Ron Johnson Date: Wed, 17 Dec 2025 12:23:15 -0500 X-Gm-Features: AQt7F2qlq_XVpIDyo3PnFRnCpMRgiDjxiJS-ra2QnnTmP2YK9zwMT2T0oBv77Fc Message-ID: Subject: Re: wal segment size To: pgsql-general Content-Type: multipart/alternative; boundary="00000000000023e4f90646291acf" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000023e4f90646291acf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Adding this to ~/.ssh/config will almost totally eliminate the cost of ssh authentication: Host * ControlMaster auto #ControlPath /run/user/%i/%L_%r_at_%n:%p ControlPath ~/.ssh/%L_%r_at_%n:%p ControlPersist 5m Pointing ControlPath to /run/user/%i is even faster, but it doesn't always exist if you sudo into the postgres service account. On Wed, Dec 17, 2025 at 11:10=E2=80=AFAM Colin 't Hart wrote: > Thanks Laurenz, that confirms what I was assuming. Archiving is via > pgbackrest to a backup server, over SSH. Approx 750ms to archive each > segment is crazy -- I'll check compression parameters too. > > Any reason not to bump it up to 1GB? Or is that overkill? > > /Colin > > On Wed, 17 Dec 2025 at 16:25, Laurenz Albe > wrote: > >> On Wed, 2025-12-17 at 16:13 +0100, Colin 't Hart wrote: >> > I see very little advice on tuning WAL segment size. >> > >> > One of my clients has a few datawarehouses at around 8 - 16 TB >> > >> > On one of the nodes there are approx 15000 WAL segments of 16MB each, >> totalling >> > approx 230GB. The archiver is archiving approx one per second, so >> approx 4 hours to clear. >> > >> > Would we gain anything by bumping the WAL segment size? >> >> Very likely yes, if the problem is the overhead of starting the >> archive_command. >> >> Another thing that can slow down archiving is if you compress these >> segments >> too aggressively. >> >> Yours, >> Laurenz Albe >> > --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --00000000000023e4f90646291acf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Adding this to ~/.ssh/config will almost totally elim= inate the cost of ssh authentication:

Host *
=C2=A0 =C2=A0 ControlMaster auto
=C2=A0 =C2=A0 = #ControlPath /run/user/%i/%L_%r_at_%n:%p
=C2=A0 =C2=A0 ControlPath ~/.ss= h/%L_%r_at_%n:%p
=C2=A0 =C2=A0 ControlPersist 5m

Pointing ControlPath to=C2=A0/run/user/%i=C2=A0is even faster, but it doesn'= t always exist if you sudo into the postgres service account.

On Wed, Dec 17, 2025 at 11:10=E2=80=AFA= M Colin 't Hart <colinthart@= gmail.com> wrote:
Thanks Laurenz, that confirms what I was assuming. Archiving is via pgback= rest to a backup server, over SSH. Approx 750ms to archive each segment is = crazy -- I'll check compression parameters too.

Any reason not to bump it up to 1GB? Or is that overkill?

<= /div>
/Colin

On Wed, 17 Dec 2025 at 16:25, Laurenz Albe <laurenz.albe@cybert= ec.at> wrote:
On Wed, 2025-12-17 at 16:13 +0100, Colin 't Hart wrote:
> I see very little advice on tuning WAL=C2=A0segment=C2=A0size.
>
> One of my clients has a few datawarehouses=C2=A0at around 8 - 16 TB >
> On one of the nodes there are approx 15000 WAL segments of 16MB each, = totalling
> approx 230GB. The archiver is archiving approx one per second, so appr= ox 4 hours to clear.
>
> Would=C2=A0we gain anything by bumping the WAL=C2=A0segment size?

Very likely yes, if the problem is the overhead of starting the archive_com= mand.

Another thing that can slow down archiving is if you compress these segment= s
too aggressively.

Yours,
Laurenz Albe


--
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobs= ter!
--00000000000023e4f90646291acf--