Answers: <p>PGBouncer is a connection pooler. So, one instance of PGBouncer should be enough in between the apps and postgres.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-08-23T03:32:43.163Z
Answers: 2021-08-23T03:32:43.163Z
Answers: Auston Barboza
Body: <p>I'm wanting to deploy some sort of connection pooling within my applications across multiple nodes. Python naturally provides some pooling with the SQLAlchemy implementation; but obviously this probably does not scale as well as 1 central pool.</p>
  
  <p>As far as I see it PGBouncer can Sit within each pod, it can be running as its own pod, or it can be running as a daemonset which ties a PGBouncer instance to be running for each kube node.</p>
  
  <p><a href="https://i.sstatic.net/vKlKw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vKlKw.png" alt="PGBouncer in container vs out"></a></p>
  
  <p>How would you / how have you deployed PGBouncer in a similar environment? </p>
  
  <p>This question is equally relevant for twemproxy.</p>
  
Tags: <kubernetes><postgresql>
Title: Where does PGBouncer sit on a Kubernetes Cluster
UserDisplayName: Callam Delaney
ThreadText: # Where does PGBouncer sit on a Kubernetes Cluster
  
  (Asked by: username_0 on 2020-03-11)
  
  I'm wanting to deploy some sort of connection pooling within my applications across multiple nodes. Python naturally provides some pooling with the SQLAlchemy implementation; but obviously this probably does not scale as well as 1 central pool.
  
  As far as I see it PGBouncer can Sit within each pod, it can be running as its own pod, or it can be running as a daemonset which ties a PGBouncer instance to be running for each kube node.
  
  [![PGBouncer in container vs out](https://i.sstatic.net/vKlKw.png)](https://i.sstatic.net/vKlKw.png)
  
  How would you / how have you deployed PGBouncer in a similar environment?
  
  This question is equally relevant for twemproxy.
  
  **Tags:** kubernetes, postgresql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-23. Score: 2
  
  PGBouncer is a connection pooler. So, one instance of PGBouncer should be enough in between the apps and postgres.
  
  
  ---
  
  