PgBouncer is a great lightweight connection pool for Postgres

Installation

Configuration

Example pgbouncer.ini configuration file

Define user authentication file: /usr/local/postgres/userlist.txt

> cat userlist.txt

Set user permissions
> chown postgres:postgres userlist.txt

Here’s a working pgbouncer.ini configuration file

users.txt

Start pgBouncer

Login

Toubleshooting

1. psql: ERROR: Unknown startup
Ensure that the “ignore_startup_parameters = application_name” entry is set in pgbouncer.ini

2. ERROR broken auth file
Ensure the username and password defined in users.txt are in quotes. E.g. “postgres” instead of postgres.

References

1. http://pgbouncer.projects.postgresql.org/doc/usage.html
2. http://wiki.postgresql.org/wiki/PgBouncer
3. http://www.techienuggets.com/Comments?tx=106898
4. http://blog.gmane.org/gmane.comp.db.postgresql.pgbouncer.general/month=20100601

About Gugulethu Ncube

IT enthusiast getting things done.