Re: Pgbouncer performance query

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: KK CHN <kkchn(dot)in(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Pgbouncer performance query
Date: 2026-01-22 16:28:02
Message-ID: 226c7ab6-5c4e-4b98-8fd5-2d5edee7e4e9@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/22/26 04:35, KK CHN wrote:
> List,
>
> I am trying pgbouncer  for inhouse deployment for PostgreSQL 16.
>
> My setup is      PostgreSQL VM : 5444 <=> Pgbouncer VM:5444  <===> Clients
> (PostgreSQL with IP 10.12.0.2  and  Pgbouncer 10.12.0.35 )
>
> Conducted an inhouse  benchmark  test (pgbench) performed,   I have seen
> the following results.
>
> On direct hit  the DB server  handled tps = 162252.508744 (without
> initial connection time)
> latency average = 1.233 ms  (Total time taken around  2 Minutes  to
> complete)
> Through Pgbouncer  it handled  tps = 25107.166425 only
> ( without initial connection time)
> latency average = 11.949 ms   ( Total time taken around 20 Minutes to
> complete )
>
> Could someone shed some light on   improving the total time taken by
> pgbouncer in this scenario ?     How can I improve the  total time
> taken  from 20 Minutes to any reasonably good value, say 5 Minutes is it
> possible  ?

The significant difference between the test setups is the introduction
of an additional VM between the clients and the database server in the
pgBouncer case.

Have you tried it with pgBouncer installed in the Postgres VM?

Also see:

https://www.pgbouncer.org/faq.html#should-pgbouncer-be-installed-on-the-web-server-or-database-server

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2026-01-22 19:12:27 Re: pg_trgm upgrade to 1.6 led to load average increase
Previous Message Adrian Klaver 2026-01-22 16:15:54 Re: [Tool] pg-status — lightweight microservice for checking PostgreSQL host status