agora inbox for pgsql-admin@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Joseph Hammerman <joe.hammerman@datadoghq.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Getting out ahead of OOM
Date: Fri, 07 Mar 2025 14:26:03 -0500
Message-ID: <1117736.1741375563@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHs7QM_8SRfybxg_Pq3orGw5anMkV7OzKYfxDXSBQVWzcXf3Bw@mail.gmail.com>
References: <CAHs7QM_8SRfybxg_Pq3orGw5anMkV7OzKYfxDXSBQVWzcXf3Bw@mail.gmail.com>
Joseph Hammerman <joe.hammerman@datadoghq.com> writes:
> We run Postgres in a Kubernetes environment, and we have not to date been
> able to convince our Compute team to create a class of Kubernetes hosts
> that have memory overcommit disabled.
:-(
> Has anyone had success tracking all the Postgres memory allocation
> configurables and using that to administratively prevent OOMing?
I doubt anyone has tried that. I would look into whether running
the postmaster under a suitable ulimit helps. I seem to recall
discussions that in Linux, "ulimit -v" works better than the other
likely-looking options. But that might be stale information.
> Alternatively, has anyone has success implementing an extension or periodic
> process to monitor the memory consumption of the Postgres children and
> killing them before the OOM event occurs?
That's not going to be noticeably nicer than the kernel-induced
OOM, I think. The one thing it might do for you is ensure that
the kill happens to a child process and not the postmaster; but
you can already use PG_OOM_ADJUST_VALUE and PG_OOM_ADJUST_FILE
to manage that if it's a problem. (Recent kernels are alleged
to usually do the right thing without that, though.)
regards, tom lane
view thread (6+ messages) latest in thread
Message-ID: <1117736.1741375563@sss.pgh.pa.us>
Permalink: ../1117736.1741375563@sss.pgh.pa.us/
Also on: postgresql.org/message-id/1117736.1741375563@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, joe.hammerman@datadoghq.com, pgsql-admin@lists.postgresql.org
Subject: Re: Getting out ahead of OOM
In-Reply-To: <1117736.1741375563@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox