From: Marko Kreen Date: Tue, 29 May 2012 08:59:54 +0000 (+0300) Subject: faq: where should pgbouncer be installed? X-Git-Tag: pgbouncer_1_5_2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ee0b01bbd18672c1954e644ccc074e45e5c7895;p=pgbouncer faq: where should pgbouncer be installed? --- diff --git a/doc/faq.txt b/doc/faq.txt index a2d9270..2d54c5b 100644 --- a/doc/faq.txt +++ b/doc/faq.txt @@ -165,7 +165,7 @@ The `server_reset_query` would only add unnecessary round-trip between transactions and would drop various caches that the next transaction would unnecessarily need to fill again. -== How to know which client is on which server connection == +== How to know which client is on which server connection? == Use SHOW CLIENTS and SHOW SERVERS views on console. @@ -187,3 +187,16 @@ local_addr + local_port:: unique port on pgbouncer host ptr:: unique id for this connection link:: unique id for client connection this is currently linked to +== Should PgBouncer be installed on webserver or database server? == + +It depends. Installing on webserver is good when short-connections are used, +then the connection setup latency is minimised - TCP requires couple of packet +roundtrips before connection is usable. Installing on database +server is good when there are many different hosts (eg. webservers) +connecting to it, then their connections can be optimised together. + +It is also possible to install PgBouncer on both webserver and database +servers. Only negative aspect of that is that each PgBouncer hop +adds small amount of latency to each query. So it's probably +best to simply test whether the payoff is worth the cost. +