On 3/24/2018 5:04 PM, Mark Thomas wrote:
Regarding your configuration:
<Resource
name="jdbc/REDACTED"
auth="Container"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
type="javax.sql.DataSource"
maxActive="60"
maxIdle="10"
maxWait="30000"
removeAbandoned="true"
removeAbandonedTimeout="30"
username="REDACTED"
password="REDACTED"
testOnBorrow="true"
validationQuery="select 1"
url="jdbc:mysql://REDACTED.REDACTED.com:3306/REDACTED?autoReconnect=true&zeroDateTimeBehavior=round"
/>
Generally, that looks OK but I'd strongly recommend that you use
"autoReconnect=false" in the URL. autoReconnect is known to be
problematic with connection pools.
The removeAbandonedTimeout looks low but if all the queries are expected
to be well under 30s then that should be OK.
Somehow I did not see this part of your email at all when I read it the
first time. I just noticed it. My previous reply probably has you
scratching your head a little bit. I'm sorry about that!
The timeout of 30 seconds is EXTREMELY low. And if it were being
honored, we would have customers lining up outside the office with
pitchforks. The webapp has reporting ability for users with elevated
privileges, and a lot of those reports take a minute or two to run,
sometimes even longer. So if the pool were killing connections after 30
seconds, the reporting mechanism would be failing a LOT. If you check
the *planned* configuration, you'll see that I have increased this
timeout to 3600. I wanted to make it 900, but some of the developers
are worried that 900 is too aggressive.
Because there are no pitchforks, I know that abandoned connection
removal is NOT happening, even though it IS configured. Plus, there's
the fact that there are MANY connections with idle times of several
hours. So that's a big part of what I'm trying to figure out -- why the
configuration we have isn't doing what it has configured. Is there
something incorrect, or something missing? Or is it maybe a bug in the
pool code that's been fixed sometime in the last five years?
The autoReconnect setting has likely been in use on our configurations
for YEARS. I will make sure we remove it in any config changes.
Thanks,
Shawn
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org