pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Withers <chris@withers.org>
To: Chris Ellis <chris@intrbiz.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Fwd: sensible configuration of max_connections
Date: Fri, 7 Feb 2020 13:18:38 +0000
Message-ID: <d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org> (raw)
In-Reply-To: <CAF0QPmjW85wFZ=44C3rxBskNG4H9iqui7eqAdAatmNAmrcFCMA@mail.gmail.com>
References: <e1c73911-cfee-8b5d-d847-2487729f35f5@withers.org>
	<CAF0QPmjXSv+wdOF_CFn0ZEHMEQekqMe93w+nCkLjX=6k2hUF_w@mail.gmail.com>
	<CAF0QPmjW85wFZ=44C3rxBskNG4H9iqui7eqAdAatmNAmrcFCMA@mail.gmail.com>

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.

view thread (9+ messages)  latest in thread

Message-ID: <d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org>
Permalink:  ../d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org/
Also on:    postgresql.org/message-id/d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: chris@withers.org, chris@intrbiz.com
  Subject: Re: Fwd: sensible configuration of max_connections
  In-Reply-To: <d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org>
  References: <e1c73911-cfee-8b5d-d847-2487729f35f5@withers.org> <CAF0QPmjXSv+wdOF_CFn0ZEHMEQekqMe93w+nCkLjX=6k2hUF_w@mail.gmail.com> <CAF0QPmjW85wFZ=44C3rxBskNG4H9iqui7eqAdAatmNAmrcFCMA@mail.gmail.com> <d555e64d-9fb8-1eb9-775a-61aaa698ad5a@withers.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox