Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZy7b-0000CT-BR for pgsql-general@arkaria.postgresql.org; Thu, 31 Mar 2022 16:58:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZy7a-0004I5-76 for pgsql-general@arkaria.postgresql.org; Thu, 31 Mar 2022 16:58:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZy7Z-0004Hw-R2 for pgsql-general@lists.postgresql.org; Thu, 31 Mar 2022 16:58:05 +0000 Received: from mail.arcict.com ([91.183.106.63] helo=arcict.com) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZy7X-0007Bf-If for pgsql-general@lists.postgresql.org; Thu, 31 Mar 2022 16:58:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=arcict.com; s=cra20arc; bh=e4E8DEpztZ7O3tc43JzSl2/B+AYe1VG6wEn0e1K41tg=; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From; b=NerzQdp4ttGaRWxcyzuEy5ztV8oa/avZOmIcnn6 7hLMDX3n3Twi1bDIwuEn1/wGqPjWAS9n23zp6KmQsi6WdiFrWhkyUX0QjCiuGNkv1llVnEFkDxz26 9PrtfXKACmWhkr71NtHo8t18q9PzjOB38V3rnqPGQRom4rAQ01fDN5A= Received: from [192.163.1.155] (account postgres@arcict.com [192.163.1.155] verified) by arcict.com (CommuniGate Pro SMTP 6.3.9) with ESMTPSA id 5421665; Thu, 31 Mar 2022 18:58:02 +0200 From: Marc To: Stephen Frost Cc: pgsql-general@lists.postgresql.org Subject: Re: PG12: Any drawback of increasing wal_keep_segments Date: Thu, 31 Mar 2022 18:58:00 +0200 X-Mailer: MailMate (1.14r5882) Message-ID: <32D37060-DF19-4AF7-8F2B-1511FC610086@arcict.com> In-Reply-To: <20220329151729.GN10577@tamriel.snowman.net> References: <202203241025.qygop5cr3qw7@alvherre.pgsql> <20220329151729.GN10577@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_FF41A52A-4AEA-4671-8A54-B8A4AE7DA0EA_=" Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_MailMate_FF41A52A-4AEA-4671-8A54-B8A4AE7DA0EA_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit On 29 Mar 2022, at 17:17, Stephen Frost wrote: > Greetings, > > * Alvaro Herrera (alvherre@alvh.no-ip.org) wrote: >> On 2022-Mar-22, Shukla, Pranjal wrote: >>> Are there any disadvantages of increasing the >>> “wal_keep_segments” to a >>> higher number say, 500? Will it have any impact on performance of >>> streaming replication, on primary or secondary servers? >> >> No. It just means WAL will occupy more disk space. I've seen people >> go >> even as high as 5000 with no issues. > > Yeah, though it makes the primary into essentially a WAL repository > and, > really, you'd be better off having a dedicated repo that replicas can > pull from instead. Consider that a replica might fall way behind and > then demand the primary send 5000 WAL segments to it. The primary > then > has to go pull that 80GB of data from disk and send it across the > network. As to if that's an issue or not depends on the IOPS and > bandwidth available, of course, but it's not free. > > Thanks, > > Stephen Hello Stephen, How do you see a setup with a ‘a dedicated repo that replicas can pull from’ ? Thanks in advance for the clarification. Marc --=_MailMate_FF41A52A-4AEA-4671-8A54-B8A4AE7DA0EA_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 29 Mar 2022, at 17:17, Ste= phen Frost wrote:

Greetings,

On 2022-Mar-22, Shukla, Pranj= al wrote:

Are there any disadvantages o= f increasing the =E2=80=9Cwal_keep_segments=E2=80=9D to a
higher number say, 500? Will it have any impact on performance of
streaming replication, on primary or secondary servers?

No. It just means WAL will o= ccupy more disk space. I've seen people go
even as high as 5000 with no issues.

Yeah, though it makes the pri= mary into essentially a WAL repository and,
really, you'd be better off having a dedicated repo that replicas can
= pull from instead. Consider that a replica might fall way behind and
= then demand the primary send 5000 WAL segments to it. The primary then has to go pull that 80GB of data from disk and send it across the
network. As to if that's an issue or not depends on the IOPS and
bandwidth available, of course, but it's not free.

Thanks,

Stephen

Hello Stephen,

How do you see a setup with a= =E2=80=98a dedicated repo that replicas can pull from=E2=80=99 ?

Thanks in advance for the cla= rification.

Marc

--=_MailMate_FF41A52A-4AEA-4671-8A54-B8A4AE7DA0EA_=--