From: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
---|---|
To: | Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | Re: PostgreSQL Memory consumption is too high |
Date: | 2025-03-14 12:19:01 |
Message-ID: | CANzqJaA3wFxujCuXg6uip96SjDL5_gjNL62T67YuSqMxUr3Zgw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Fri, Mar 14, 2025 at 7:54 AM Siraj G <tosiraj(dot)g(at)gmail(dot)com> wrote:
> Hello -
>
> I need help in determining what is consuming so much memory in the cloud
> SQL (GCP managed) instance running with "PostgreSQL 16.6 on
> x86_64-pc-linux-gnu, compiled by Debian clang version 12.0.1, 64-bit".
>
> Server spec: 16 vcpu and 128GB
>
> Consistently, CACHE % is 59 - 60% and USAGE is around 39 - 40%. Therefore
> we have just around 0.5% free available memory.
>
By design, Linux uses all memory. What the applications don't use, Linux
uses to cache data.
After all, you're paying for 128GB of RAM, so you might as well put it to
good use. Since the application isn't using it, Linux uses it
on your behalf..
Be *concerned* if USAGE is up around 90%. Be *worried* if it starts using
swap space (if swap even exists in GCP).
> I ran queries to get shared_buffers and other values.
> Here are the details:
> shared_buffers: 42GB
> work_mem: 4MB
> maintenance_work_mem: 64MB
> max_connections: 5900 (however, most of the times we have under 150
> concurrent sessions)
> There are no extensions installed.
>
You can probably kick work_mem up to 16MB.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
From | Date | Subject | |
---|---|---|---|
Next Message | Motog Plus | 2025-03-18 08:02:11 | Background writer not much active |
Previous Message | Siraj G | 2025-03-14 11:54:07 | PostgreSQL Memory consumption is too high |