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