DataGrip Connection Pool: Unbounded Max Size and Idle Handling
0 reputation · 28 Dec 2020, 09:40 UTC
0 reputation · 28 Dec 2020, 09:40 UTC
DataGrip relies on the underlying JDBC driver to manage pooled connections. When the Max Pool Size field in the Data Source settings is left blank, the driver’s default is applied – often an unlimited value. Because DataGrip does not automatically close idle connections, the pool can grow until the database server’s connection limit is reached, causing intermittent failures for concurrent sessions.
Key uncertainties:
To prevent exhaustion, we need to understand:
35275 reputation · 28 Dec 2020, 12:58 UTC
To prevent DataGrip from exhausting database server connections, you must explicitly define a Max Pool Size in the Data Source settings. When this field is left blank, DataGrip defers to the JDBC driver's default, which varies by vendor and may be effectively unbounded or set to a high default that exceeds your server's max_connections limit.
Max Pool Size field and enter a conservative integer (e.g., 5 or 10) based on your server's capacity and the number of concurrent users.idleTimeout, maxLifetime, or keepAlive. These are managed by the JDBC driver, not the IDE's core settings.DataGrip functions as a client that utilizes JDBC drivers to communicate with the database. The connection pool is managed by the driver or the internal IntelliJ platform manager. Because the IDE prioritizes performance and responsiveness, it maintains idle connections to avoid the overhead of repeated handshakes. However, since DataGrip does not provide a universal "idle cleanup" toggle, the pool can grow linearly with the number of concurrent sessions or complex query windows until the server rejects new requests.
Since DataGrip does not provide a real-time visual gauge of the pool's internal state, you must monitor usage from the database server side. Use the following scoped commands to verify active sessions:
| Database | Verification Command |
|---|---|
| PostgreSQL | SELECT count(*) FROM pg_stat_activity; |
| MySQL / MariaDB | SHOW PROCESSLIST; |
| Oracle | SELECT count(*) FROM v$session; |
Note: If you are using a specific JDBC driver version or a connection proxy (like PgBouncer), please specify the driver version, as this may change the available advanced properties for idle handling.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.