-
Task
-
Resolution: Unresolved
-
Normal
-
None
The way pgbouncer works, a separate connection pool is created for every (database, user) pair that connects to pgbouncer. (Thus there can be multiple pools per database if multiple users connect to it.)
I would like us to collect stats on every pool to see how client/server connections are distributed and being used. These stats can be found by connecting the the virtual pgbouncer database on floyd, and running SHOW POOLS:
psql -h 10.2.2.44 -p 65401 -U postgres -d pgbouncer -c 'SHOW POOLS;'
It'd be great to collect the following stats, separately for each pool (database, user pair): cl_active, cl_waiting, sv_active, sv_idle, sv_used. Documentation on what these columns mean can be found here: https://www.pgbouncer.org/usage#show-pools
Additionally, there's a SHOW STATS command which has other useful information: https://www.pgbouncer.org/usage#show-stats This contains two sets of statistics, one for total values (the total_* columns) and one for average values (the avg_* columns). We should perhaps have two separate graphs for these. All of the values seem potentially useful, so we might just want to graph them all, but the ones I'm most interested in are *_xact_count, *_query_count, and *_wait_time.