> On Sep 26, 2024, at 7:03 AM, yudhi s <learnerdatabas...@gmail.com> wrote:
>
> In a RDS postgres ...
> Is it fine to let it use "FreeLocalStorage" unless it goes till zero?
Hi Yudhi,
FreeLocalStorage and some of the other things you ask about are specific to AWS
RDS, so you might have better luck getting answers on an RDS-specific mailing
list. We also use RDS-hosted Postgres and so I completely understand how
Postgres and RDS are intertwined.
We have had runaway queries exhaust FreeLocalStorage. It has been quite a while
since that happened, so my memories are hazy, but I’m pretty sure that when we
used all of FreeLocalStorage, the result was that Postgres restarted. It might
be equivalent to using all memory and disk space on a standalone system. Once
there’s no storage left, behavior is unpredictable but we can’t be surprised if
things crash. Usually our runaway queries got killed before FreeLocalStorage
filled up, but not always.
I second Veem’s suggestion to set work_mem on a per-session basis. Also note
that the doc for work_mem says, “the total memory used could be many times the
value of work_mem; it is necessary to keep this fact in mind when choosing the
value."
https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
Cheers
Philip