Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

Connection pooling

Connection pooling is a strategy to reduce the amount of active connections and the costs of reopening connections. It requires maintaining a set of persistently opened connections, called a pool, that can be reused by clients.

Since PostgreSQL spawns separate processes for client connections, it can be beneficial in some use cases to maintain a client side connection pool rather than increase the database connection limits and resource consumption.

A way to achieve this with Charmed PostgreSQL is by integrating with the PgBouncer charm.

Increasing maximum allowed connections

If using PgBouncer is not enough to handle the connections load of your application, you can increase the amount of connections that PostgreSQL can open via the experimental_max_connections config parameter.

Disclaimer: Each connection opened by PostgreSQL spawns a new process, which is resource-intensive. Use this option as a last resort.

Contact us for more guidance about your use-case.

Last updated a month ago. Help improve this document in the forum.