Skip Navigation

Queries prioritization using pgbouncer

Hi there!

I have a pg cluster serving different services, with one of them, (let's call it SL), non-critical, but hammering the database with lots of (mostly) short lived queries.

Since I implemented a connection pooler (pgbouncer), I've noticed a great improvement in throughput, and the SL service is now much more responsive than before. That said, I think this was quite detrimental to fairness overall, because some of the other services which used to respond fairly well now happen to timeout often.

I was wondering if there's any way to prioritize queries execution (ideally by user or database) so that the high-frequency/low criticality service leaves way to anything else that comes up. To my surprise, nothing comes up from my googling of "pgbouncer prioritization" or "pgbouncer fairness". pgcat seems to offer some loadbalancing and sharding, but that seems to be only applicable for multi-server setups. Any idea/suggestion?

Thanks!

0
0 comments