pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Aleš Zelený <zeleny.ales@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
Date: Mon, 11 Jul 2022 04:07:00 -0600
Message-ID: <25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com> (raw)
In-Reply-To: <CAODqTUaZAqkmiFpB-Sy5yqTrC6iJR1GyB5JRXLuitxJjR3_B=Q@mail.gmail.com>
References: <CAODqTUaZAqkmiFpB-Sy5yqTrC6iJR1GyB5JRXLuitxJjR3_B=Q@mail.gmail.com>



> On Jul 11, 2022, at 2:50 AM, Aleš Zelený <zeleny.ales@gmail.com> wrote:
> 
> 
> Hello,
> 
> we are experiencing out-of-memory issues after Postygres upgrade from 14.3 to 14.4 on CentOS7.
> 
> OS: CenotOS7
> 
> No OOM killer messages in the syslog. SWAP is disabled.
> 
> -bash-4.2$ sysctl -q vm.overcommit_memory
> vm.overcommit_memory = 2
> 
> [root@sts-uat-pgsql100 ~]# swapon -vs
> [root@sts-uat-pgsql100 ~]# 
> 
> [root@sts-uat-pgsql100 ~]# sysctl -q vm.overcommit_ratio
> vm.overcommit_ratio = 95
> 
> 
> -bash-4.2$ uname -r
> 3.10.0-1160.42.2.el7.x86_64
> 
> -bash-4.2$ free -h
>               total        used        free      shared  buff/cache   available
> Mem:            39G        7,8G        220M         10G         31G         20G
> Swap:            0B          0B          0B
> 
> 
> 
> postgres=# show shared_buffers ;
>  shared_buffers
> ----------------
>  10GB
> (1 row)
> 
> postgres=# show  work_mem ;
>  work_mem
> ----------
>  4MB
> (1 row)
> 
> postgres=# show maintenance_work_mem ;
>  maintenance_work_mem
> ----------------------
>  512MB
> (1 row)
> 
> postgres=# show max_parallel_workers;
>  max_parallel_workers
> ----------------------
>  8
> (1 row)
> 
> postgres=# show max_parallel_maintenance_workers ;
>  max_parallel_maintenance_workers
> ----------------------------------
>  2
> (1 row)
> 
> postgres=# select count(*) from pg_stat_activity ;
>  count
> -------
>     93
> (1 row)
> 
> postgres=# show max_connections ;
>  max_connections
> -----------------
>  1000
> (1 row)
> 
> No changes on the application side were made before the out-of-memory happened.
> 
> 
> 
> So far, it has happened three times (during a single week) from the 14.3 -> 14.4 upgrade, before 14.4 we haven't suffered from such an issue.
> 
> Questions:e. 
> 1)  Can we safely downgrade from 14.4 to 14.3 by shutting down the instance and reinstalling 14.3 PG packages (to prove, that the issue disappear)?

> 2) What is the best way to diagnose what is the root cause?
You can turn on sql logging to see what query is causing the crash. 
Has any new code added anything with 
   a.id!= b.id
on any large table?




What we have started to collect:

When you think you see it happening you can query the
System tables for currently running queries. pg_stat*


> - vmstat -nwt (per second)
> - vmstat -nawt (per






view thread (22+ messages)  latest in thread

Message-ID: <25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com>
Permalink:  ../25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com/
Also on:    postgresql.org/message-id/25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, zeleny.ales@gmail.com
  Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
  In-Reply-To: <25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com>
  References: <CAODqTUaZAqkmiFpB-Sy5yqTrC6iJR1GyB5JRXLuitxJjR3_B=Q@mail.gmail.com> <25016EDA-F9BF-419A-B58D-0CE2199C5B95@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox