Cannot allocate memory

From: "JOIGNY Michael (at)Neteven" <mjoigny(at)neteven(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Cannot allocate memory
Date: 2020-09-18 10:03:50
Message-ID: e839bc32-d827-c840-88ae-52acc3a359eb@neteven.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Community,

I'm asking for your lights because i'm having memory problems with postgres.

Examples of logs :

/FATAL: could not fork new process for connection: Cannot allocate
memory could not fork new process for connection: Cannot allocate memory
out of memory  DETAIL:  Failed on request of size 32800 in memory
context "HashBatchContext".
out of memory DETAIL Failed on request of size 288 in memory context
"CacheMemoryContext".
/

We use postgresql (primary/standby) with pgbouncer as a pooler, and
repmgr as replication manager.

We have ~ 2000 connections at the same time with ~ 20/30 are active. (we
need to set a high number of connexion on postgres, because our app uses
a lot of different users, and each user on each app server needs
multiple and constant connexions).

Here is my configuration :

_system : _

Debian : 9.13
Memory : 380 Go
Postgres : 12.4-1.pgdg90+1
Pgbouncer : 1.14
kernel.shmmax = 202591600640
kernel.shmall = 49460840

_postgres :
_

dynamic_shared_memory_type = posix    # the default is the first option
max_connections = 2600            # (change requires restart)
work_mem = 96MB                # min 64kB
maintenance_work_mem = 8GB        # min 1MB
shared_buffers = 64GB            # min 128kB
temp_buffers = 32MB            # min 800kB
wal_buffers = 16MB            # min 32kB, -1 sets based on shared_buffers
effective_cache_size = 270GB

pgbouncer :

max_client_conn = 6000
default_pool_size = 2590
reserve_pool_size = 5
pool_mode = session

Do you think that our parameters are not correct compared to our
configuration? Do you have an idea ?

Best regards.

Michael.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2020-09-18 10:58:27 Re: Monitoring
Previous Message dbatoCloud Solution 2020-09-18 03:38:25 Re: Monitoring