Re: Pgbouncer

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Rajesh Kumar <rajeshkumar(dot)dba09(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Pgbouncer
Date: 2023-11-16 11:59:47
Message-ID: suqrxftd5i2rd4y2oprgv27xqd2bjhtncgph7m5duwvwndqs5y@wjc235it7xey
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2023-11-16 06:43 +0100, Rajesh Kumar wrote:
> I am using postgres 15 in redhat openshift container. I am trying to
> configure pgbouncer.
>
> I want to know how to find in database whether the connections are from
> pgbouncer or direct connections? Or, is there any other way to monitor in
> this environment?

You can check column pg_stat_activity.client_addr if your pgbouncer and
the clients making direct connections are on different hosts.

Otherwise you can list pgbouncer's connections with SHOW SERVERS in the
admin console[1] and cross-check with pg_stat_activity. Columns
local_addr and local_port of SHOW SERVERS matches client_addr and
client_port in pg_stat_activity. The remaining connections in
pg_stat_activity should be from other clients and backends.

[1] https://www.pgbouncer.org/usage.html#admin-console

--
Erik

In response to

  • Pgbouncer at 2023-11-16 05:43:48 from Rajesh Kumar

Responses

  • Re: Pgbouncer at 2023-11-16 12:17:18 from Achilleas Mantzios - cloud

Browse pgsql-admin by date

  From Date Subject
Next Message Nikhil Ingale 2023-11-16 12:03:52 bulk DMLs
Previous Message Rajesh Kumar 2023-11-16 05:43:48 Pgbouncer