WikiPrint - from Polar Technologies

PgBouncer

  1. Instalacja (Debian)
apt-get install pgbouncer
  1. Konfiguracja

vim /etc/pgbouncer/pgbouncer.ini

[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
  1. Restart usługi
/etc/init.d/pgbouncer restart
  1. Konfiguracja eDokumenty (config.inc)

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');