Re: Suggestion for memory parameters

From: Philip Semanchuk <philip(at)americanefficient(dot)com>
To: yudhi s <learnerdatabase99(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Suggestion for memory parameters
Date: 2024-09-30 15:16:20
Message-ID: A57336D3-37A0-413F-8D74-B41607359DC6@americanefficient.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Sep 26, 2024, at 7:03 AM, yudhi s <learnerdatabase99(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sud 2024-09-30 20:01:57 Question on session timeout
Previous Message Nikhil Ingale 2024-09-30 10:58:31 Re: Trouble in generating the plpgsql procedure code