Re: pgbouncer best practices

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема Re: pgbouncer best practices
Дата
Msg-id CABwTF4WXR_8thXQA-V6OvCSbifj15-AZ78HGjfMUzAg=Zn=RtA@mail.gmail.com
обсуждение исходный текст
Ответ на pgbouncer best practices  (Rita <rmorgan466@gmail.com>)
Список pgsql-general
On Fri, Jul 7, 2023 at 9:24 AM Rita <rmorgan466@gmail.com> wrote:
>
> My question are: is there a ratio of max connections and pool i should use in my pgbouncer config?

Short answer: No, there's no recommended ratio for PG max_connections
and pgbouncer pool size.

In pgbouncer, a client connection is matched (forwarded) to a server
connection in the pool. But if all the server connections in the pool
are already busy servicing other client connections, then any newly
active client connections are made to wait until a server connection
is available.

Depending on your workload, there are recommendations for how large to
set the max_connections on Postgres. But for connection poolers like
pgbouncer, there really isn't a recommended upper limit. Since every
connection (whether idle or active) takes up memory (~2kB), the only
upper limit is how much RAM you have available for pgbouncer to use.

It's been a while since I used pgbouncer, so there might be
inconsistencies here. Someone with more current knowledge may want to
correct me.

Best regards,
Gurjeet
http://Gurje.et



В списке pgsql-general по дате отправления:

Предыдущее
От: Ben Chobot
Дата:
Сообщение: Re: pgbouncer best practices
Следующее
От: Rita
Дата:
Сообщение: Re: pgbouncer best practices