Re: Fwd: sensible configuration of max_connections - Mailing list pgsql-general

From Chris Withers
Subject Re: Fwd: sensible configuration of max_connections
Date
Msg-id d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org
Whole thread Raw
In response to Fwd: sensible configuration of max_connections  (Chris Ellis <chris@intrbiz.com>)
Responses Re: Fwd: sensible configuration of max_connections  (Steve Atkins <steve@blighty.com>)
List pgsql-general
On 07/02/2020 12:49, Chris Ellis wrote:
What's "too much" for max_connections? What happens when you set it to
high? What factors affect that number?

When sizing max_connections you need to trade off how many connections your application will use at peak vs how much RAM and CPU you have.

Each connection is capable of allocating work_mem and has a stack etc.

As such you don't want max_connections to be able to run your system out of RAM.
Sure, but that's where I'm trying to find out what's sensible. The box has 196GB memory, most of that in hugepages, 18 core Intel Skylake with HT on giving 36 cores and tonnes of SSD for storage. How would I turn that spec into a sensible number for max_connections? As that number grows, what contention points in postgres will start creaking (shared memory where the IPC happens?)

In case I forgot to say, this is PostgreSQL 11...

Chris

PS: definitely thinking of pg_bouncer, but still trying to figure out what to sensibly set for max_connections.

pgsql-general by date:

Previous
From: Chris Ellis
Date:
Subject: Fwd: sensible configuration of max_connections
Next
From: Justin
Date:
Subject: Re: sensible configuration of max_connections