What are advantages of using transaction pooling with pgbouncer?

后端 未结 1 374
我在风中等你
我在风中等你 2020-12-28 13:58

I\'m having trouble finding a good summary of the advantages/disadvantages of using pgbouncer for transaction pooling vs session pooling.

Does it mean that a transac

相关标签:
1条回答
  • 2020-12-28 14:46

    Transaction-level pooling will help if you have apps that hold idle sessions. PgBouncer won't need to keep sessions open and idle, it just grabs one when a new transaction is started. Those idle sessions only cost you a pgbouncer connection, not a real idle Pg session with a backend sitting around wasting memory & synchronisation overhead doing nothing.

    The main reason you'd want session pooling instead of transaction pooling is if you want to use named prepared statements, advisory locks, listen/notify, or other features that operate on a session level not a transaction level.

    0 讨论(0)
提交回复
热议问题