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 1vWVoo-002ZTT-0f for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 08:26:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWVol-0077G1-2A for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 08:26:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWVol-0077Ft-0h for pgsql-general@lists.postgresql.org; Fri, 19 Dec 2025 08:26:31 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWVok-001TS5-1g for pgsql-general@lists.postgresql.org; Fri, 19 Dec 2025 08:26:31 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5957ac0efc2so1766264e87.1 for ; Fri, 19 Dec 2025 00:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766132788; x=1766737588; darn=lists.postgresql.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=I7m80LMRBB5L2R/McpYkBUYh3H0L2nsoIGO1Cdt2gV4=; b=fOlKuaVG+ezk7JrQ4RfbeL6I0/RWS+zVO4f8RURTzX7M4+NRzxpSo0kARiRoWIVOuG FBqeQP4qi0YpPrwPInSZYD44gX5XCAvckXsG50XKVNKB6tEgaAJQkLhbut4YO7uXYT86 fQM8niIhHXNL6M3CO21e8lg9dTvpQJQVYtTdtCfhBrlFg95cHuk6zMvef79zVhX9pSWB y8ZiD/JmtAMcDjk+YFTWQCLGaKpyaTVrdfYVPZyCQlzKv/rKXZb665RCynt2VNUh/Wh+ bug2fA2dtlFeDtCp0fr/jvofr+FeUD14YCiHGnYBn5B1r6NWq4vXVY862QITFkW1g7Io P1DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766132788; x=1766737588; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=I7m80LMRBB5L2R/McpYkBUYh3H0L2nsoIGO1Cdt2gV4=; b=sfmnaQPCIRyhr22yUzOIshWkFWdrvd7mEYU9IDos+XbVDHuiu60gtyxVzQTmr0HuGm zkSSEZ5u19JWH/eZ5w002AD4v1h/YGrWtG8S1e3dMRnzHo2PSZQYofK7j9GsXa4IxdX+ bfMq5PQ7xF7DZye3fi2CcI9BnKAzrlq4+Tjd8FGMklnZG4CkhwKraQ9SfiLsJVWYwkAe 9KtXbnq27LaznOZbKQdWSnnPGduXzGmCkxlntGbBRhzbsazudlDlsJ/bI3YgZrU/fjtq OkFG/qufbocw0N8gfPW7DFgdUhl5ovb2/yY2XVvk3Ftu6qAbVxei3L2xoMDcPKxPcxCu lJBg== X-Forwarded-Encrypted: i=1; AJvYcCUNrS5m8mabJbR+kAMxHfn9BtuQv/CXR4HD751GC+NwqpXwNcQs9jLYlybYNFEvbmd/2aZJdL3W1maZNdC9@lists.postgresql.org X-Gm-Message-State: AOJu0YxjOM38Y3wlISJHPGNzJwpk+uYhy8ijEtz6zBdpEKI6bdB23fAa j8b3voF108XibqAgvoo9ky1RttRKjkHSaBrORauRHBnuPCC7gNjvFAhm X-Gm-Gg: AY/fxX4p8lDnO6B0Bc034NsSkAnlKryJ/DLcB0oo9WHMBD1nJcpxEnb/cbB74pGdgA6 YqYa8ckU6dsK9V+TXmDYpBbVuVwf9edNbCHFiB7vEoekxsyC55obzQoz1PEmYnKJyfMf+P3BTNW Ocuc/DTI3kwbSumDWE5z/KMdznqyDUJy5piHro/QgAOuQPehLXXciiqr+9na/XzKoLzNavLd234 /sXjARnx74CEnOhfaOU4tHvgtCXjEGagqSFPI2i8ZV3YoCB64AL5JdsODdnybEbD0I3zFZWRGJe Mvuuvgmh/63pNabx1BRCkj8D6JDKDp1DBSn3DBc7krPvt69sICKcVg6SH+4zLiIRH10IKzRhjJM Xl0xxf68K+TgTnFXORt5EqzskdYYa0KSJbcazbCQEOunDI7vSg3p+tjlCTLDsC7VyUq+uTn3Ith W7IsLVcknNJpnAsLaCc/RqBIQRqTaZUFqjozlPQMW1Bw== X-Google-Smtp-Source: AGHT+IEklIj+Sx2k1X1bckd4BGVK0pQJrUQgR+YBbZiP+LFdp3x91RlOqgBPFagw9SBUEVGMKEuPlA== X-Received: by 2002:a05:6512:6d3:b0:598:f874:51b5 with SMTP id 2adb3069b0e04-59a17d67be5mr822767e87.39.1766132788253; Fri, 19 Dec 2025 00:26:28 -0800 (PST) Received: from smtpclient.apple ([2a02:aa1:114f:88e8:d150:fc5c:5a36:40cf]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59a186287e3sm512504e87.97.2025.12.19.00.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 00:26:27 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andrew Mime-Version: 1.0 (1.0) Subject: Re: wal segment size Date: Fri, 19 Dec 2025 09:26:17 +0100 Message-Id: <2890CAF1-6B00-440E-B8FF-3D333DFC5AF3@gmail.com> References: <4e2cfc51d3933a1df28e212ccb0b90f39633422a.camel@cybertec.at> Cc: Greg Sabino Mullane , Colin 't Hart , PostgreSQL General In-Reply-To: <4e2cfc51d3933a1df28e212ccb0b90f39633422a.camel@cybertec.at> To: Laurenz Albe X-Mailer: iPhone Mail (23C55) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk As an oracle dba new to Postgres, I=E2=80=99m used to the concept of context= switches and latch issues with regards to transaction log switches. Does Po= stgres have a similar mechanism with latching etc when it switches to a new w= al segment that is alleviated when increasing the size of the wal segments? Regards Andrew Sent from my iPhone > On 17 Dec 2025, at 18:58, Laurenz Albe wrote: >=20 > =EF=BB=BFOn Wed, 2025-12-17 at 12:21 -0500, Greg Sabino Mullane wrote: >>> 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 pgba= ckrest >>> to a backup server, over SSH. Approx 750ms to archive each segment is cr= azy -- >>> I'll check compression parameters too. >>=20 >> Switch to archive-async =3D on. When doing that, the typical time drops t= o 10ms or less. >> Also use a compress-type of lz4 or zst, which perform way better than the= default gz. >> If you are encrypting, that's a bottleneck you just have to deal with, no= shortcuts there. :) >=20 > I second that. Asynchronous archiving in pgBackRest tends to work around t= he problem. >=20 >> tl;dr try other things before messing with the WAL size. The current size= can work very >> well even on very large and very, very busy systems. >=20 > On the other hand, 16MB on a very busy system is somewhat ridiculous. > A somewhat bigger segment size may be appropriate. >=20 > Yours, > Laurenz Albe >=20 >=20