Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqe8i-008I32-Fp for pgsql-admin@arkaria.postgresql.org; Fri, 07 Mar 2025 20:17:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqe8g-00Gr8I-UY for pgsql-admin@arkaria.postgresql.org; Fri, 07 Mar 2025 20:17:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqe8g-00Gr88-HY for pgsql-admin@lists.postgresql.org; Fri, 07 Mar 2025 20:17:46 +0000 Received: from qs51p00im-qukt01080101.me.com ([17.57.155.18]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tqe8c-001Yvg-1u for pgsql-admin@lists.postgresql.org; Fri, 07 Mar 2025 20:17:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=M81Y5RWhfkazCQA4YVgtqsfnB9Fct9wV89mRqt5XZ2U=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To:x-icloud-hme; b=OlaHljmFdtnCm3XeBeKuvO7Fdx2jDGmIVcsQx5E36EuSeQsQhEXR752+erzqBWQtF QFTvREGP2Ka5PP4w4RVif57ENPW9WXGhtBjYEJ10kmp9wUnU6pgOqhOrfh3JE1Mbm5 TgR/t//NmsaEcd56gHMWc/lZAnlBf4iuBKPCrJAQKKvf7je+QLNnriMC04ze2tFLgO uSTquKz4OgP1wkC5fzVb2gIIFIvViJtI2NyK9/QigNfuXZi74b29RBKX8U9uPwUWkZ UHfKqhtmURUfC8KNJ6ETQ2T3ZT4m9P4x2ljwaT5XGp0fAPBiaCBEkInlwynXYw3ZRN liMZmJElgbhJA== Received: from smtpclient.apple (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01080101.me.com (Postfix) with ESMTPSA id 5A60D61802E2; Fri, 7 Mar 2025 20:17:40 +0000 (UTC) From: Rui DeSousa Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_516ADBFB-4838-4225-9B45-FE177E3FBCC2" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: Getting out ahead of OOM Date: Fri, 7 Mar 2025 15:17:37 -0500 In-Reply-To: Cc: pgsql-admin@lists.postgresql.org To: Joseph Hammerman References: X-Mailer: Apple Mail (2.3696.120.41.1.10) X-Proofpoint-GUID: ijJC7EodMHnobj6v3x2_eW3Qs9--B-vF X-Proofpoint-ORIG-GUID: ijJC7EodMHnobj6v3x2_eW3Qs9--B-vF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-07_07,2025-03-07_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 phishscore=0 clxscore=1031 spamscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2503070153 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_516ADBFB-4838-4225-9B45-FE177E3FBCC2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 7, 2025, at 2:07 PM, Joseph Hammerman = wrote: >=20 > Has anyone had success tracking all the Postgres memory allocation = configurables and using that to administratively prevent OOMing? Don=E2=80=99t use memory limits in Kubernetes and we also run Postgres = on dedicated Kubernetes clusters. Shared memory will get counted multiple times. Each login session; as = it maps in the shared buffers, it will get wrongly counted as memory = used (it is shared memory!). =20 I have instances running on Kubernetes that only use 6GB of memory; = however Kubernetes is wrongly reporting 50GB used due to number of = active seasons. Our Postgres pods use to get terminated when = =E2=80=9Cexceeding" the limit but not! Until removed the use of memory = limits in Kubernetes. --Apple-Mail=_516ADBFB-4838-4225-9B45-FE177E3FBCC2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Mar 7, 2025, at 2:07 PM, Joseph Hammerman <joe.hammerman@datadoghq.com> wrote:

Has anyone had success tracking = all the Postgres memory allocation configurables and using that to = administratively prevent OOMing?

Don=E2=80=99t use memory limits in Kubernetes = and we also run Postgres on dedicated Kubernetes = clusters.

Shared= memory will get counted multiple times.  Each login session; as it = maps in the shared buffers, it will get wrongly counted as memory used = (it is shared memory!).  

I have instances running on Kubernetes = that only use 6GB of memory; however Kubernetes is wrongly reporting = 50GB used due to number of active seasons.  Our Postgres pods use = to get terminated when =E2=80=9Cexceeding" the limit but not! Until = removed the use of memory limits in Kubernetes.




= --Apple-Mail=_516ADBFB-4838-4225-9B45-FE177E3FBCC2--