Re: Suggestion for memory parameters - Mailing list pgsql-general

From Philip Semanchuk
Subject Re: Suggestion for memory parameters
Date
Msg-id A57336D3-37A0-413F-8D74-B41607359DC6@americanefficient.com
Whole thread Raw
In response to Suggestion for memory parameters  (yudhi s <learnerdatabase99@gmail.com>)
Responses Re: Suggestion for memory parameters
List pgsql-general

> On Sep 26, 2024, at 7:03 AM, yudhi s <learnerdatabase99@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
gettinganswers on an RDS-specific mailing list. We also use RDS-hosted Postgres and so I completely understand how
Postgresand 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
equivalentto using all memory and disk space on a standalone system. Once there’s no storage left, behavior is
unpredictablebut we can’t be surprised if things crash. Usually our runaway queries got killed before FreeLocalStorage
filledup, 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
memoryused 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


pgsql-general by date:

Previous
From: Nikhil Ingale
Date:
Subject: Re: Trouble in generating the plpgsql procedure code
Next
From: sud
Date:
Subject: Question on session timeout