Question

I have a django website where the application and database server are different. I need to install pgbouncer to enable database pooling, however, I'm confused about where to install it: web application server or database server?

Note that in this set up, there is exactly 1 application server and 1 database server.

Was it helpful?

Solution

I would recommend first installing it on the database server. That way you can run top (or whatever) on that machine and have a one-stop-shop to see what is going on. Also, the dependencies are more likely to already be installed on the database server than they are on the application server.

If you then notice the database server is more heavily loaded than the app server, you can move it to the app server. But looking at the current loads (when you don't have connection pooling in place) to make that decision isn't going to be terribly useful, because they could change dramatically once you start pooling.

OTHER TIPS

This is a official FAQ from pgbouncer web site:

WEB vs DB

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top