pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: klaus.mailinglists@pernau.at
To: pgsql-general@postgresql.org
Subject: PANIC:  could not flush dirty data: Cannot allocate memory
Date: Mon, 14 Nov 2022 22:04:09 +0100
Message-ID: <ec01f7af535c0c38711a317cba2aa310@pernau.at> (raw)

Hi all!

We have a setup with a master and plenty of logical replication slaves. 
Master and slaves are 12.12-1.pgdg22.04+1 runnning on Ubuntu 22.04.
SELECT pg_size_pretty( pg_database_size('regdns') ); is from 25GB (fresh 
installed slave) to 42GB (probably bloat)

Replication slaves VMs have between 22G and 48G RAM, most have 48G RAM.

We are using:
maintenance_work_mem = 128MB
work_mem = 64MB

and VMs with 48G RAM:
effective_cache_size = 8192MB
shared_buffers = 6144MB

and VMs with 22G RAM:
effective_cache_size = 4096MB
shared_buffers = 2048MB

On several servers we see the error message: PANIC:  could not flush 
dirty data: Cannot allocate memory

Unfortunately I do not find any reference to this kind of error. Can you 
please describe what happens here in detail? Is it related to server 
memory? Or our memory settings? I am not so surprised that it happens 
with the 22G RAM VM. It is not happening on our 32G RAM VMs. But it also 
happens on some of the 48G RAM VMs which should have plenty of RAM 
available:
# free -h
                total        used        free      shared  buff/cache   
available
Mem:            47Gi         9Gi       1.2Gi       6.1Gi        35Gi     
    30Gi
Swap:          7.8Gi       3.0Gi       4.9Gi

Of course I could upgrade all our VMs and then wait and see if it solved 
the problem. But I would like to understand what is happening here 
before spending $$$.

Thanks
Klaus






view thread (12+ messages)  latest in thread

Message-ID: <ec01f7af535c0c38711a317cba2aa310@pernau.at>
Permalink:  ../ec01f7af535c0c38711a317cba2aa310@pernau.at/
Also on:    postgresql.org/message-id/ec01f7af535c0c38711a317cba2aa310@pernau.at

 · 

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: klaus.mailinglists@pernau.at
  Subject: Re: PANIC:  could not flush dirty data: Cannot allocate memory
  In-Reply-To: <ec01f7af535c0c38711a317cba2aa310@pernau.at>
  References: <ec01f7af535c0c38711a317cba2aa310@pernau.at>

* 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