Re: Estimated resources for a 500 connections instance (VM)

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: David Gauthier <davegauthierpg(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Estimated resources for a 500 connections instance (VM)
Date: 2020-04-07 17:19:46
Message-ID: 3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2020-04-07 17:26:22 Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12
Previous Message Andrus 2020-04-07 17:09:26 Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12