Postgresql – Meaning of query in pgbouncer.log

pgbouncerpostgresql

I could not find any documentation about pgbouncer log, I'm assuming it has the same meaning as the SHOW STATS ?

req/s – number of requests since last stat period
in b/s – Bytes per sec received ?
out b/s – Bytes per sec sent ?
query – Total query duration in micro secs ou avg query duration in micro secs ?

I need to better understand this query column to implement reliable log monitoring.

Another issue I'm facing is the fact that I seldom see more than 0 requests on log lines and most of the times the query value is greater than 10s.

Best Answer

After checking pgbouncer source code in stats.c file, I realized that values shown in the log are all average values for that logging period.

Avg number of requests is mostly zero because there's less than 60 queries in a logging period which is about 1 minute.