Out of Memory error triggering replica to transition into recovery mode - Mailing list pgsql-admin

From Siraj G
Subject Out of Memory error triggering replica to transition into recovery mode
Date
Msg-id CAC5iy61uGHGfLpR2Wded8ZniyKqREeDBdeJ4ryXZ5jwU6-oKyg@mail.gmail.com
Whole thread Raw
Responses Re: Out of Memory error triggering replica to transition into recovery mode
List pgsql-admin
Hello Experts!

As the subject says, today very frequently our replica DB is going into the recovery mode causing an outage in the application side. 

Here are the server  & details:
Server type: Compute engine
OS: Ubuntu 20
Pgsql: 12.2
CPUs: 64
Memory: 128GB
Shared_buffers: 32GB
Work_mem: 256MB
maintenance_work_mem = 3GB
shared_buffers = 32GB
max_connections = 4000
Total size of the DBs: 3TB

The application is designed in such a way that it consumes data primarily from SECONDARY. And, there are several applications of such type. I can see tons of messages in the postgres log being written as:
"IP, 2024-11-28 ,<db name>, <user>,1, FATAL: the database system is in recovery mode"

This indicates that the app services are trying to connect to the DB constantly and there are tons of them.

Any advice on how we can improvise the situation.

Regards
Siraj

pgsql-admin by date:

Previous
From: SOzcn
Date:
Subject: Re: DB Switch over and Switch back support
Next
From: Tom Lane
Date:
Subject: Re: Out of Memory error triggering replica to transition into recovery mode