Agroal connection pool sizing for peak concurrency
25.6K reputation · 20 Jun 2025, 09:29 UTC
Database Connection Pool Management
Quarkus uses the Agroal connection pool to handle JDBC connections. To prevent database-side resource exhaustion, the quarkus.datasource.jdbc.max-size property establishes the upper bound of available connections, while quarkus.datasource.jdbc.acquisition-timeout manages how long a thread waits for a connection during periods of high demand.
Configuration Constraints
There is a tension between maintaining a high max-size to handle concurrent request spikes and avoiding the exhaustion of the database server's own process limits. When min-size is set too high, resources may be wasted during low-traffic periods, yet setting it too low can increase latency during initial bursts.
What is the recommended strategy for balancing max-size against the database's global connection limit in a clustered Quarkus environment? How should the acquisition-timeout be tuned to differentiate between a temporary spike and a genuine connection leak?