public inbox for [email protected]  
help / color / mirror / Atom feed
From: Siraj G <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: DB load balancer
Date: Tue, 5 Aug 2025 10:18:15 +0530
Message-ID: <CAC5iy61X3Yr-KUfegB61FKE5MP-sbe=Fectsyk8EpFZ4b1t=aA@mail.gmail.com> (raw)

Hello Experts!

We have a multi tenant model DB with a Primary and a Secondary. There are
3x or 4x connections flowing to Secondary as the application is read
intensive. Accordingly we have allocated more number of resources to the VM
hosting the secondary/replica DB.

Spec:-
Primary: 48 CPUs, 48GB memory
Secondary: 80 CPUs, 128GB memory
PG version: 12.22 (we have already started the upgrade process)
OS: Ubuntu

The problem very frequently we are experiencing is that the CPU load on the
SECONDARY is going very very high causing the app slowness. Also,
frequently the postgres is crashing due to OOM.

I was thinking of these (please give feedback):
1. Have a DB level balancer for the load balancing in the DB level, meaning
primary will also receive the READ traffic
2. Add a second REPLICA and configure load balancer for the connection load
balancing

What do we do for load balancing at the DB level, in postgres?

If there are any suggestions, please let me know.

Regards
Siraj


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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: DB load balancer
  In-Reply-To: <CAC5iy61X3Yr-KUfegB61FKE5MP-sbe=Fectsyk8EpFZ4b1t=aA@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox