pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PG12: Any drawback of increasing wal_keep_segments
5+ messages / 4 participants
[nested] [flat]

* PG12: Any drawback of increasing wal_keep_segments
@ 2022-03-22 11:32 Shukla, Pranjal <pshukla@akamai.com>
  2022-03-24 10:25 ` Re: PG12: Any drawback of increasing wal_keep_segments Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Shukla, Pranjal @ 2022-03-22 11:32 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Team,
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?

Thanks & Regards
Pranjal Shukla


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG12: Any drawback of increasing wal_keep_segments
  2022-03-22 11:32 PG12: Any drawback of increasing wal_keep_segments Shukla, Pranjal <pshukla@akamai.com>
@ 2022-03-24 10:25 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-03-29 15:17   ` Re: PG12: Any drawback of increasing wal_keep_segments Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2022-03-24 10:25 UTC (permalink / raw)
  To: Shukla, Pranjal <pshukla@akamai.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 2022-Mar-22, Shukla, Pranjal wrote:

> Team,
> 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.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG12: Any drawback of increasing wal_keep_segments
  2022-03-22 11:32 PG12: Any drawback of increasing wal_keep_segments Shukla, Pranjal <pshukla@akamai.com>
  2022-03-24 10:25 ` Re: PG12: Any drawback of increasing wal_keep_segments Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2022-03-29 15:17   ` Stephen Frost <sfrost@snowman.net>
  2022-03-31 16:58     ` Re: PG12: Any drawback of increasing wal_keep_segments Marc <postgres@arcict.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Stephen Frost @ 2022-03-29 15:17 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Shukla, Pranjal <pshukla@akamai.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

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

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG12: Any drawback of increasing wal_keep_segments
  2022-03-22 11:32 PG12: Any drawback of increasing wal_keep_segments Shukla, Pranjal <pshukla@akamai.com>
  2022-03-24 10:25 ` Re: PG12: Any drawback of increasing wal_keep_segments Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-03-29 15:17   ` Re: PG12: Any drawback of increasing wal_keep_segments Stephen Frost <sfrost@snowman.net>
@ 2022-03-31 16:58     ` Marc <postgres@arcict.com>
  2022-03-31 16:59       ` Re: PG12: Any drawback of increasing wal_keep_segments Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Marc @ 2022-03-31 16:58 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-general@lists.postgresql.org

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG12: Any drawback of increasing wal_keep_segments
  2022-03-22 11:32 PG12: Any drawback of increasing wal_keep_segments Shukla, Pranjal <pshukla@akamai.com>
  2022-03-24 10:25 ` Re: PG12: Any drawback of increasing wal_keep_segments Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-03-29 15:17   ` Re: PG12: Any drawback of increasing wal_keep_segments Stephen Frost <sfrost@snowman.net>
  2022-03-31 16:58     ` Re: PG12: Any drawback of increasing wal_keep_segments Marc <postgres@arcict.com>
@ 2022-03-31 16:59       ` Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Stephen Frost @ 2022-03-31 16:59 UTC (permalink / raw)
  To: Marc <postgres@arcict.com>; +Cc: pgsql-general@lists.postgresql.org

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

>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-03-31 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 11:32 PG12: Any drawback of increasing wal_keep_segments Shukla, Pranjal <pshukla@akamai.com>
2022-03-24 10:25 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-03-29 15:17   ` Stephen Frost <sfrost@snowman.net>
2022-03-31 16:58     ` Marc <postgres@arcict.com>
2022-03-31 16:59       ` Stephen Frost <sfrost@snowman.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox