Configuring connection pooling for JDBC-based connectors
Learn how to configure connection pooling capabilities for JDBC-based Trino
connectors. Connection pooling helps in better performance, resource utilization, and
stability while querying different data sources using Trino.
Currently, a new database connection is created for every query or sub-query, which
causes several inefficiencies:
Performance Overhead: Significant latency from repeatedly setting up and tearing
down connections.
Resource Exhaustion: Rapidly opening and closing connections can deplete the
database server resources, leading to failures.
Scalability Challenges: The overhead of managing individual connections becomes
a bottleneck as the number of users and queries grows.
Connection pooling is currently supported for the following JDBC-based
connectors:
MySQL
PostgreSQL
MariaDB
Teradata
Oracle
Log in to the Cloudera Data Warehouse service and click
Federation Connectors.
The Federation Connectors page is displayed that
lists all the currently configured connectors.
For the JDBC-based connector for which you want to enable connection pooling,
click > Edit Configuration.
In the General Details tab, add the following connection
pooling configurations as key-value pairs in the
Configuration section:
Key
Description
Default Value
connection-pool.enabled
Enables or disables connection pooling for the
connector.
false
connection-pool.max-size
Specifies the maximum number of connections in the
pool.
30
connection-pool.max-connection-lifetime
Specifies the maximum lifetime (in minutes) of a
connection in the pool.
30m
connection-pool.pool-cache-max-size
Specifies the maximum number of data sources cached in
memory.
1000
connection-pool.pool-cache-ttl
Specifies the duration (in minutes) after which an
inactive data source is dropped.