Recently, our DB server got hit by high load. When I went to investigate, there were 49 queries from the same user for the same database. I checked our pgbouncer.ini, and sure enough, default_pool_size is set to 20 (we only turned it down to 20 fairly recently, it used to be higher). There are no per-database changes, and the only per-user change is not for the user in question.
Now I am checking on pools that are larger than default_pool_size + reserve_pool_size (5), and it's happening fairly regularly. E.g. in the last five minutes, from SHOW POOLS;
:
database | user | cl_active | cl_waiting | sv_active | sv_idle | sv_used | sv_tested | sv_login | maxwait | pool_mode
redacted_db | redacted | 1047 | 2 | 37 | 0 | 0 | 0 | 1 | 0 | transaction
I've checked SHOW CONFIGS
to make sure the values are set as they are in pgbouncer.ini. Have I completely misunderstood how pgbouncer works? Or is there some nuance that I've missed?