Presuming that our calculated pool size was 25, with a memory-imposed maximum of 350, follow these steps to properly configure PgBouncer:
- Execute this query as the postgres user while connected to any database within PostgreSQL:
COPY ( SELECT '"' || rolname || '" "' || coalesce(rolpassword, '') || '"' FROM pg_authid ) TO '/etc/pgbouncer/userlist.txt';
- Open the /etc/pgbouncer/pgbouncer.ini file as the postgres system user.
- Under the section labeled [databases], create the following entry:
postgres = host=localhost
- Under the section labeled [pgbouncer], find the listen_addr entry and change it to the following:
listen_addr = *
- Under the section labeled [pgbouncer], find the auth_type entry and change it to the following: ...