Unable to acquire JDBC Connection [HikariPool-1 - Connection is not available, request timed out - PostgreSQL

codenozee
HOBBY

3 months ago

Hi there,
My spring boot application couldn't connect to my PostgreSQL database. I am seeing the following time errors:

Caused by: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection [HikariPool-1 - Connection is not available, request timed out after 30000ms (total=10, active=10, idle=0, waiting=2)] [n/a] .....

It seems all available pool connections were used and not connection was available to handle my requests. My applications are deployed on a Hobby plan where my DB is configured with 8 vCPU and 8GB of RAM.

How can I mitigate this issue ? Is there a way to increase the max number of total connections in my pool ? Is that recommended ? Any other suggestions ?

Thank you

$10 Bounty

3 Replies

sim
FREETop 10% Contributor

2 months ago

Can you check for connection leak? Just start with are you closing all open connections?


sim
FREETop 10% Contributor

2 months ago


sim
FREETop 10% Contributor

2 months ago

Is that recommended ?

Depends on the situation, you can add to it if there is no leak issues. You can research how to use pooling like PGBbouncer


Unable to acquire JDBC Connection [HikariPool-1 - Connection is not available, request timed out - PostgreSQL - Railway Help Station