From: Victor Sudakov <vas@sibptus.ru>
To: pgsql-admin@lists.postgresql.org
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: pgbouncer logs and its efficiency
Date: Thu, 3 Feb 2022 15:15:44 +0000
Message-ID: <YfvxoLCXKDPk/xEp@admin.sibptus.ru> (raw)
In-Reply-To: <a19711e2-c7b7-28e2-6878-85c996f08ef3@enterprisedb.com>
References: <YfNtsr+D6JKPmncK@admin.sibptus.ru>
<2d4321bd-0174-42c9-3671-fa9626326d10@enterprisedb.com>
<YfpEkSZ/TUtZRQe6@admin.sibptus.ru>
<a19711e2-c7b7-28e2-6878-85c996f08ef3@enterprisedb.com>
Peter Eisentraut wrote:
> On 02.02.22 09:45, Victor Sudakov wrote:
> >>> 2. How would you calculate the efficiency of pgbouncer, like
> >>> client_conns/server_conns ratio (current and average over over time)?
> >>
> >> This depends heavily on what you are using pgbouncer for and what
> >> metrics are relevant for your application.
> >
> > The relevant metric would be the client_conns/server_conns ratio. If
> > there have been 1000 client connections/disconnections and they have
> > caused only 100 new backends to start, I'd consider it a good ratio.
> >
> > The question is how to estimate it.
>
> You can count the number of rows in the SHOW CLIENTS and SHOW SERVERS
> output and chart them using your favorite metrics collection system.
> There are various tools and recipes out there on how to collect metrics
> from pgbouncer and push them into metrics or graphing systems.
Hello Peter,
If I were going to continuously monitor the pgbouncer efficiency, it
would be a good idea. Maybe there is even a Prometheus exporter for
pgbouncer.
However, do you think this information can be inferred from pgbouncer
logs in some way? Because I need it only occasionally.
If, for example, I divide the number of "login attempt" lines in the
log by the number of "new connection to server" lines, will this be
the ratio I'm looking for?
--
Victor Sudakov VAS4-RIPE
http://vas.tomsk.ru/
2:5005/49@fidonet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: vas@sibptus.ru, pgsql-admin@lists.postgresql.org, peter.eisentraut@enterprisedb.com
Subject: Re: pgbouncer logs and its efficiency
In-Reply-To: <YfvxoLCXKDPk/xEp@admin.sibptus.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox