apt-get install pgbouncer
cp /etc/pgbouncer/pgbouncer.ini /etc/pgbouncer/pgbouncer.ini.orig vim /etc/pgbouncer/pgbouncer.ini # wyczyścić wszystko i wkleić poniższą zawartość
[databases] * = [pgbouncer] logfile = /var/log/postgresql/pgbouncer.log pidfile = /var/run/postgresql/pgbouncer.pid listen_addr = 127.0.0.1 listen_port = 6432 unix_socket_dir = /var/run/postgresql auth_type = trust auth_file = /etc/pgbouncer/userlist.txt admin_users = postgres stats_users = postgres pool_mode = transaction log_connections = 0 log_disconnections = 0 stats_period = 300
vim /etc/pgbouncer/userlist.txt
"postgres" "" "edokumenty" "" "http" ""
vim /etc/default/pgbouncer
START=1
/etc/init.d/pgbouncer restart
W stałej "DB_NAME" zmieniamy/ustawiamy port na podany w "listen_port" (z konfiguracji pgbouncer.. dmyślnie: 6432). np.
define('DB_NAME', 'dbname=edokumenty port=6432 user=http');