Re: Estimating wal_keep_size

From: Vijaykumar Jain <vijaykumarjain(dot)github(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: "Dean Gibson (DB Administrator)" <postgresql(at)mailpen(dot)com>, Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Estimating wal_keep_size
Date: 2021-06-18 18:40:08
Message-ID: CAM+6J97miBu6pxE8E_OVya4u5X8J+Oaefi0FU3o8gA_qmb-Rgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 18 Jun 2021 at 23:58, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> Le sam. 19 juin 2021 à 02:13, Dean Gibson (DB Administrator) <
> postgresql(at)mailpen(dot)com> a écrit :
>
>>
>> Granted, but the same question arises about the value for
>> max_slot_wal_keep_size. Setting either too low risks data loss, & setting
>> either too high results in unnecessary disk space used. The question was,
>> is the estimated VALUE reasonable under the circumstances?
>>
>
> it may be, until one day it won't be. and that day usually happens. when
> you set up this kind of limit you choose service availability over your
> data, so you have to accept that it may not be enough. if this is a problem
> don't setup a limit.
>
>>
yep, that day does come :) and in that case, i used to drop slot (primary
is high priority) and rebuild the repica. We already had multiple replicas
under load balancer, so it was feasible.

Anyways, I used to emit pg_current_wal_lsn to graphite (or any other
telemetry monitoring) every minute or so, ot be able to calculate wal
growth over period of time.
Then used it to estimate how much of the disk would be required for a PITR
setup like barman if we use a 7 day WAL post backup.
one can use other math expressions like <time>moving avg to estimate wal
growth over the time duration of an incident with the replica etc.
ofcourse one needs to also calculate how fast the wals would be played
back, if one has hot_standby_feedback for long running queries on replicas
etc but I think I put my point.

--
Thanks,
Vijay
Mumbai, India

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Manuel Weitzman 2021-06-20 00:09:58 Re: Planning performance problem (67626.278ms)
Previous Message Julien Rouhaud 2021-06-18 18:27:44 Re: Estimating wal_keep_size