Re: Pgbouncer performance query

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "KK CHN" <kkchn(dot)in(at)gmail(dot)com>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Pgbouncer performance query
Date: 2026-01-23 15:04:24
Message-ID: 64661152-e769-4771-82b1-e789d1dbfd27@manitou-mail.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

KK CHN wrote:

> default_pool_size = 40

That limits the number of connections from pgBouncer to the database
to 40. That's per user/database, but pgbench connects to the same
database/same user. So when running pgbench -c 200, without pgBouncer
there are 200 active connections, whereas through pgBouncer there are
only 40 active connections in Postgres.

When queries are issued to pgBouncer and the 40 connections
are already busy, it makes them wait.

That alone might explain why the average latencies are so different
between pgBouncer and direct connections.

If you really want to support 200 concurrent clients, increase the pool
size accordingly.

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message KK CHN 2026-01-23 18:14:45 Resource Usage same In spite of fronting my DB server with Pgbouncer ?
Previous Message KK CHN 2026-01-23 04:24:42 Re: Pgbouncer performance query