Re: Estimated resources for a 500 connections instance (VM) - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Estimated resources for a 500 connections instance (VM)
Date
Msg-id 3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at
Whole thread Raw
In response to Estimated resources for a 500 connections instance (VM)  (David Gauthier <davegauthierpg@gmail.com>)
Responses Re: Estimated resources for a 500 connections instance (VM)
List 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




pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12
Next
From: Pavel Stehule
Date:
Subject: Re: Performance degradation if query returns no rows and columnexpression is used after upgrading to 12