0

We occasionaly hit org.apache.tomcat.jdbc.pool.PoolExhaustedException when threads are holding connections for too long or are going into a deadlock state.

Any recomendation to tweak in Tomcat's DB Connection Configuration or Data source Factory Configuration ?

2023-04-16 20:46:20,104 ERROR Exception occurred 36032 org.apache.tomcat.jdbc.pool.PoolExhaustedException: [https-jsse-nio] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available [size:200; busy:200; idle:0; lastwait:30000] .36033 at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:738)

We tried changing removeAbandoned = true, testOnBorrow = true, testOnReturn = true but we still run into the problem. Anything further to check ?

Maicol
  • 55
  • 4
Dice
  • 3
  • 1
  • 3
  • 1
    Do you know what is the longest execution time of your queries? You can set the removeAbandonedTimeout to this time in seconds. Default is 60. Maybe too long? – Mar-Z Apr 17 '23 at 19:32
  • Without knowing anything about the type and volume of your Tomcat's workload, it seems like _quite a lot_ to have 200 connections and all of them busy. So, you may be able to manage the issue through pool settings, but tackling the root causes seems like a necessity (obvious comment, I know, and maybe you are already doing that). – andrewJames Apr 17 '23 at 19:57
  • @Mar-Z Longest running query will be within 5 mins. But we would want to identify these bottlenecks. Your suggestion is to set removeAbandonTimeout=60 sec ? – Dice Apr 17 '23 at 20:05
  • No. To 5+1=6 sec – Mar-Z Apr 17 '23 at 20:31

0 Answers0