PgPool-II
PgPool-II is an open-source middleware for PostgreSQL that sits between clients (back-end storage modules like mod-inventory-storage) and the PostgreSQL database servers.
Main features are Connection Pooling, Replication and Load Balancing. Learn the complete feature set on the PgPool-II website https://www.pgpool.net/
Connection Pooling
Overview: https://b-peng.blogspot.com/2020/07/connection-pooling-in-pgpool.html
connection_cache
should be disabled because all back-end storage modules already cache connections:
- Raml-Module-Builder (RMB) based modules have the DB_MAXPOOLSIZE and DB_CONNECTIONRELEASEDELAY environment variable configuration options.
- The ERM back-end modules have their pool configuration in mod-agreements application.yml and mod-licenses application.yml.
- Spring based back-end modules use the default datasource settings unless overwritten in application.yml.
In addition an enabled connection_cache may lead to a high number of open connections in a multi tenant installation.
client_idle_limit
must be disabled because the ERM back-end modules (mod-agreements, mod-licenses) and Spring based back-end modules keep connections with prepared statements open and will fail with this error message if pgpool assigns a different back-end connection: "org.postgresql.util.PSQLException: ERROR: prepared statement \"S_74\" already exists"