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
3 Replies
2 months ago
Can you check for connection leak? Just start with are you closing all open connections?
2 months ago
Here is a solution on how to increase the pool https://stackoverflow.com/questions/73686592/manually-increase-number-of-connections-to-be-used-in-hikari-pool
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