[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: PG12: Any drawback of increasing wal_keep_segments
From:       Stephen Frost <sfrost () snowman ! net>
Date:       2022-03-31 16:59:44
Message-ID: CAOuzzgpbjftE6z6=oD5Y2ti85ypaLE7iVVv=5y8nHneEivxhww () mail ! gmail ! com
[Download RAW message or body]

Greetings,

On Thu, Mar 31, 2022 at 12:58 Marc <postgres@arcict.com> wrote:

> 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.
>
I'd suggest checking out pgbackrest. There are other options out there but
that's my favorite (probably because I also am one of the folks involved in
its development, full disclosure).

Thanks,

Stephen

>

[Attachment #3 (text/html)]

<div dir="auto">Greetings,</div><div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Thu, Mar 31, 2022 at 12:58 Marc &lt;<a \
href="mailto:postgres@arcict.com">postgres@arcict.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><u></u>





<div><div style="font-family:sans-serif"><div \
style="white-space:normal;font-family:sans-serif"> <p dir="auto" style="margin:1.12em \
0px;font-family:sans-serif">On 29 Mar 2022, at 17:17, Stephen Frost wrote:</p> \
<blockquote style="margin:0px 0px \
5px;padding-left:5px;border-left-width:2px;border-left-style:solid;font-family:sans-serif;border-left-color:rgb(57,131,196);color:rgb(57,131,196)">
 <p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Greetings,</p>
<ul style="font-family:sans-serif">
<li style="font-family:sans-serif">Alvaro Herrera (<a \
href="mailto:alvherre@alvh.no-ip.org" target="_blank" \
style="font-family:sans-serif">alvherre@alvh.no-ip.org</a>) wrote:</li> </ul>
<blockquote style="margin:0px 0px \
5px;padding-left:5px;border-left-width:2px;border-left-style:solid;font-family:sans-serif;border-left-color:rgb(124,191,12);color:rgb(124,191,12)">
 <p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">On 2022-Mar-22, \
Shukla, Pranjal wrote:</p> <blockquote style="margin:0px 0px \
5px;padding-left:5px;border-left-width:2px;border-left-style:solid;font-family:sans-serif;border-left-color:rgb(124,191,12);color:rgb(124,191,12)">
 <p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Are there any \
disadvantages of increasing the "wal_keep_segments" to a<br> higher number say, 500? \
Will it have any impact on performance of<br> streaming replication, on primary or \
secondary servers?</p> </blockquote>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">No.  It just means WAL \
will occupy more disk space.  I&#39;ve seen people go<br> even as high as 5000 with \
no issues.</p> </blockquote>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Yeah, though it makes \
the primary into essentially a WAL repository and,<br> really, you&#39;d be better \
off having a dedicated repo that replicas can<br> pull from instead.  Consider that a \
replica might fall way behind and<br> then demand the primary send 5000 WAL segments \
to it.  The primary then<br> has to go pull that 80GB of data from disk and send it \
across the<br> network.  As to if that&#39;s an issue or not depends on the IOPS \
and<br> bandwidth available, of course, but it&#39;s not free.</p>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Thanks,</p>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Stephen</p>
</blockquote>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">Hello Stephen,</p>
<p dir="auto" style="margin:1.12em 0px;font-family:sans-serif">How do you see a setup \
with a ‘a dedicated repo that replicas can pull from' ?</p> <p dir="auto" \
style="margin:1.12em 0px;font-family:sans-serif">Thanks in advance for the \
clarification.</p></div></div></div></blockquote><div dir="auto">I'd suggest checking \
out pgbackrest. There are other options out there but that's my favorite (probably \
because I also am one of the folks involved in its development, full \
disclosure).</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div \
dir="auto"><br></div><div dir="auto">Stephen</div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div><div \
style="font-family:sans-serif"><div \
style="white-space:normal;font-family:sans-serif"><p dir="auto" style="margin:1.12em \
0px;font-family:sans-serif"></p></div></div></div></blockquote></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic