pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David Gauthier <davegauthierpg@gmail.com>
To: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Estimated resources for a 500 connections instance (VM)
Date: Tue, 07 Apr 2020 19:19:46 +0200
Message-ID: <3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at> (raw)
In-Reply-To: <CAMBRECDfz6Zjzy0Bitf+WhKcYZ+j=rvJDe7JN5tZ8etu7E-J8Q@mail.gmail.com>
References: <CAMBRECDfz6Zjzy0Bitf+WhKcYZ+j=rvJDe7JN5tZ8etu7E-J8Q@mail.gmail.com>

On Tue, 2020-04-07 at 12:24 -0400, David Gauthier wrote:
> psql (9.6.0, server 11.3) on linux
> 
> We've ramped up usage on a PG server (a VM, I have no choice about this) and are approaching the
> 100 connections limit.  We could increase the limit, but I've read that this can lead to a
> degradation in performance. If we bump it up to 500, what kind of compute resources would that
> require (mem/cpu)?  Any estimates ?

You should upgrade to the latest minor release.

Don't increase max_connections.  The main problem is that the more connections
there are, the greater the likelihood that too many of them will be active,
overloading the database machine.

This can for example happen if a DDL statement has to wait behind a lock.
Then other queries will "pile up" behind it, and as soon as the DDL is done
or canceled, the avalance will break loose.

The better solution is to use a connection pool.  If your application doesn't
have one, use pgBouncer.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (9+ messages)  latest in thread

Message-ID: <3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at>
Permalink:  ../3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at/
Also on:    postgresql.org/message-id/3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, davegauthierpg@gmail.com
  Subject: Re: Estimated resources for a 500 connections instance (VM)
  In-Reply-To: <3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at>
  References: <CAMBRECDfz6Zjzy0Bitf+WhKcYZ+j=rvJDe7JN5tZ8etu7E-J8Q@mail.gmail.com> <3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at>

* 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