Re: Fwd: sensible configuration of max_connections

From: Chris Withers <chris(at)withers(dot)org>
To: Chris Ellis <chris(at)intrbiz(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Fwd: sensible configuration of max_connections
Date: 2020-02-07 13:18:38
Message-ID: d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin 2020-02-07 13:29:30 Re: sensible configuration of max_connections
Previous Message Chris Ellis 2020-02-07 12:49:53 Fwd: sensible configuration of max_connections