foodb =
; redirect bardb to bazdb on localhost
-bardb = host=127.0.0.1 dbname=bazdb
+bardb = host=localhost dbname=bazdb
; acceess to dest database will go with single user
forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1'
; ip address or * which means all ip-s
listen_addr = 127.0.0.1
listen_port = 6432
-; unix socket is also used for -R
-unix_socket_dir = /tmp
+
+; unix socket is also used for -R.
+; On debian it should be /var/run/postgresql
+;unix_socket_dir = /tmp
;;;
;;; Authentication settings
;
; Query for cleaning connection immidiately after releasing from client.
+; No need to put ROLLBACK here, pgbouncer does not reuse connections
+; where transaction is left open.
;
; Query for 8.3+:
; DISCARD ALL;
; Older versions:
; RESET ALL; SET SESSION AUTHORIZATION DEFAULT
;
-server_reset_query =
+; Empty if transaction pooling is in use.
+;
+server_reset_query = DISCARD ALL
;
; Comma-separated list of parameters to ignore when given
; When taking idle server into use, this query is ran first.
; SELECT 1
;
-server_check_query = select 1
+;server_check_query = select 1
; If server was used more recently that this many seconds ago,
; skip the check query. Value 0 may or may not run in immidiately.
-server_check_delay = 10
+;server_check_delay = 30
;;;
;;; Connection limits
; total number of clients that can connect
max_client_conn = 100
+
+; defalt pool size. 20 is good number when transaction pooling
+; is in use, in session pooling it needs to be the number of
+; max clients you want to handle at any moment
default_pool_size = 20
; how many additional connection to allow in case of trouble
; if a clients needs to wait more than this many seconds, use reserve pool
;reserve_pool_timeout = 3
-log_connections = 1
-log_disconnections = 1
+; log if client connects or server connection is made
+;log_connections = 1
+
+; log if and why connection was closed
+;log_disconnections = 1
; log error messages pooler sends to clients
-log_pooler_errors = 1
+;log_pooler_errors = 1
; If off, then server connections are reused in LIFO manner
CF_ABS("autodb_idle_timeout", CF_TIME_USEC, cf_autodb_idle_timeout, 0, "3600"),
-CF_ABS("server_reset_query", CF_STR, cf_server_reset_query, 0, ""),
+CF_ABS("server_reset_query", CF_STR, cf_server_reset_query, 0, "DISCARD ALL"),
CF_ABS("server_check_query", CF_STR, cf_server_check_query, 0, "select 1"),
CF_ABS("server_check_delay", CF_TIME_USEC, cf_server_check_delay, 0, "30"),
CF_ABS("query_timeout", CF_TIME_USEC, cf_query_timeout, 0, "0"),