Re: problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350 - Mailing list pgsql-admin

From Fabrice Chapuis
Subject Re: problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350
Date
Msg-id CAA5-nLBjwDeXTbsMxL-fwbfQ8asoCG0uG6hCMzPt2MLysdwFwQ@mail.gmail.com
Whole thread Raw
In response to problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350  (Fabrice Chapuis <fabrice636861@gmail.com>)
Responses Re: problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350
List pgsql-admin
Thanks for answering Laurenz,

I think the value of max_connections must be aligned with primary because the goal is to maintain this sizing in case of a failover and promotion of the standby.
Why to be conservative with `max_connection` and not with shared buffer?
If we're performing recovery on a machine with significantly fewer CPU and RAM resources than the original server, lowering these parameters could be an option because they reserve memory at starting.

These are the questions I've been asking to myself.

On Mon, Mar 2, 2026 at 4:20 PM Fabrice Chapuis <fabrice636861@gmail.com> wrote:
Thanks for answering Laurenz,

I think the value of max_connections must be aligned with primary because the goal is to maintain this sizing in case of a failover and promotion of the standby.
Why to be conservative with `max_connection` and not with shared buffer?
If we're performing recovery on a machine with significantly fewer CPU and RAM resources than the original server, lowering these parameters could be an option because they reserve memory at starting.

These are the questions I've been asking to myself.

On Mon, Mar 2, 2026 at 3:36 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Mon, 2026-03-02 at 11:27 +0100, Fabrice Chapuis wrote:
> I got this error from restoring a backup on a recovery machine.
> I got error about the max_connections that I changed from 350 to 100.
> in the control file the value is 350
> /usr/pgsql-17/bin/pg_controldata -D /pgdata/pgsql/17/main/ | grep max_conn
> max_connections setting:              350
> That is the value registered from the primary. But the primary is not intended to be connected during this restore.
> primary_conninfo is desactivated.
>
> Is there a trick to change decrease this value and start the instance.

Why bother?

Leave max_connections at 350.

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350
Next
From: Laurenz Albe
Date:
Subject: Re: problem during postgres restore: max_connections = 100 is a lower setting than on the primary server, where its value was 350