Book Image

PostgreSQL Server Programming - Second Edition

Book Image

PostgreSQL Server Programming - Second Edition

Overview of this book

Table of Contents (21 chapters)
PostgreSQL Server Programming Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Connection Pooling


PL/Proxy does not include a connection pooler and it is a good idea to use one like pgbouncer and pgpool. A connection pooler is a utility that helps you reduce the operating cost of database, when its large number of physical connections are pulling performance down.

PL/Proxy opens a connection to each partition from each backend process and a large number of connections can bring the performance of the server down. Using the connection pool will allow you to multiplex a lot of client connections over a small number of database connections. The pgbouncer is a recommended connection pooler because it's lightweight and very easy to setup. PL/Proxy attempts to connect to pgbouncer using the same database connection interface that it uses to connect to any PostgreSQL database. The client application supplies the IP address of the host running pgbouncer and the port number on which pgbouncer is listening for connections.