This could be due to any of the following:
- The datasource connection pool has not been tuned (e.g. max-pool-size and blocking-timeout-millis) correctly for the maximum load on the application.
- The application is leaking connections because it is not closing them and thereby returning them to the pool.
- Threads with connections to the database are hanging and holding on to the connections.
Make sure that the min-pool-size
and max-pool-size
values for the respective datasource are set according to application load testing
and connections are getting closed after use inside the application code.