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

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Estimated resources for a 500 connections instance (VM)
Дата
Msg-id 3fd51f3222a35e227484afae34796d3f4f667567.camel@cybertec.at
обсуждение исходный текст
Ответ на Estimated resources for a 500 connections instance (VM)  (David Gauthier <davegauthierpg@gmail.com>)
Ответы Re: Estimated resources for a 500 connections instance (VM)
Список 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 по дате отправления:

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Performance degradation if query returns no rows and columnexpression is used after upgrading to 12