-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jerry,

On 7/29/15 9:47 AM, Jerry Malcolm wrote:
> On 7/29/2015 3:49 AM, Konstantin Kolinko wrote:
>> 2015-07-29 8:38 GMT+03:00 Jerry Malcolm
>> <techst...@malcolms.com>:
>>> I am trying to move my client to Tomcat 8 from 7.
>> Tomcat version = ?
> version 8.0.15

Any reason not to upgrade to 8.0.24? 8.0.15 is nearly a year out of
date and there have been a bunch of performance, security, and
stability fixes made. It shouldn't have any effect on your current
problem, but upgrading would be worth your time.

>>> We've been on 7 for a year or two and have not had any major
>>> issues.  I read through the 7-->8 migration instructions.  As
>>> far as I can tell, I have renamed all of the resource config
>>> parameters that changed (maxTotal, maxWaitMillis, 
>>> removedAbandonedOnBorrow).
>> There are two pool implementations in Tomcat 7 as well as in
>> Tomcat 8. Which one are you using? (Your factory = ?)
> I looked at my <resource> tags, and I'm not specifying a factory 
> attribute at all.

Then you are using the default commons-DBCP-based connection pool. The
configuration is different for each one, so it's important we know
which one you have.

> What has the default been in TC7 and TC8 without a factory being 
> specified?

commons-DBCP for both, though TC7 used DBCP 1.2 and TC 8 uses DBCP 2.
It's possible you have found a bug in DBCP2 but at this point, it's
unlikely since nobody else is really having this kind of problem.

> Could leaving this off actually be the cause of running out of
> connections?

No, it just chooses the connection pool factory.

>>> But after running for a couple of hours, I start getting "Too
>>> Many Connections" exceptions when connecting to the db. 
>>> Granted, there's a chance I have some connection leaks in the
>>> code, and I'll look into those.  But this hasn't been an issue
>>> on 7 for the past year or two.  And shouldn't removeAbandoned
>>> clean those up?  I've got logAbandoned set to 'true', and
>>> nothing is showing up in the logs. Is this exception referring
>>> to running out of available connections in the pool?
>> Describe "this exception" in more detail.
>> 
>> What component logs that message? (class, method name that
>> accompany the log message) Stack trace?
> Stack trace at the very bottom of this note
>>> Is there something else I need to change in the configuration
>>> to move to Tomcat 8 that I've overlooked?
>> 
>> Read official documentation for Apache Commons DBCP pool 
>> http://commons.apache.org/proper/commons-dbcp/configuration.html
>> 
>> Maybe you will notice some discrepancies with your
>> configuration.
> 
> I'll keep looking.  But I'm very curious that even though I might
> have connection leaks, what is preventing Tomcat from abandoning
> them and returning them to the pool as I believe I have it
> configured to do?

Do you have a test environment you can instrument? I highly recommend
setting maxTotal="1" (or maxActive="1" for DBCP 1.2 for Tomcat 7) and
using whatever spelling of logAbandoned="true" for your DBCP version.
That will find leaks pretty quickly, especially the ones that can
cause deadlocks in production if you aren't careful.

http://blog.christopherschultz.net/index.php/2009/03/16/properly-handlin
g-pooled-jdbc-connections/

> I've got logAbandoned set to true.  But I'm not seeing a single
> entry in the logs about connections being abandoned.

What's the abandoned timeout?

> Off topic, but relevant.... it sure would be nice if the xml parser
> for <resource> tags and other config items would flag with errors
> any parameter misspellings such as using the old obsolete
> 'removeAbandoned' instead of the new 'removeAbandonedOnBorrow',
> etc. or even just typo misspells.

It does:

Jul 02, 2015 10:17:25 AM
org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory get
ObjectInstance
WARNING: Name = diagnosis Property maxActive is not used in DBCP2, use
maxTotal instead. maxTotal default value is 8. You have set value of
"1" for "maxActive" property, which is being ignored.

...

WARNING: Name = diagnosis Property removeAbandoned is not used in
DBCP2, use one or both of removeAbandonedOnBorrow or
removeAbandonedOnMaintenance instead. Both have default value set to
false. You have set value of "true" for "removeAbandoned" property,
which is being ignored.


(I have a context.xml that I want to use between both Tomcat 7 and
Tomcat 8, so I actually have both spellings of those attributes in my
XML.)

What does your <Resource> element actually look like? (Remember to
remove sensitive information such as passwords.)

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVuO08AAoJEBzwKT+lPKRYlNgQAI/MQUBV45kvHxv8Ma8Kj8EV
xQ3njp1FoCXmdqzfSptrJ+eQh7EkJZ4dJ5sqvTysfl71JgetgwdleD3muaJfW0ES
xmQysVfTzaj88bj18P0OE8vps6T/4+V/mAB/qqttsdvviY9pnFzMzKUq2PQNaoIn
H0L2SW6frseKVGSh8hJ63JvC42d1HGjPpLy4Mmx19/J3c+TSckj7ywyKMeTr90yd
tm1xlmX+EW2DFebmfJ+ywCgugt2um+Zr9G5c9pmmKyeVGAvhDE5+iygFjBWkwvhj
FXL25vmOxa3bGnuakEC5LAr7oet11IlYeN2/CARsRKeNXGEJTfC1AZ+GK96quFxS
DD5gakEn2m9WFQNW+kvZRPG/7Jr7b2zVoz/H0H4ahzDWv/jyOf2YSQxfb23+curh
V3sWt8LOnJNX0hetoEvnkLn+nWIxKpTFSVmT0dc9PbRRcKb0vZmOzcgPqOBeQa/c
dARLaaVUXNIciW+4W/V5N8THVTZ75Lk2E42r7A8eSvUssgsEVtDhv3tZKZCKV5B4
ry977SiEoDJICebADCQArtpQGaGh6oPk3Xl2qeAXahvoiQzYhIbN92vfJOVqOg4H
Z0vG28icUv7kLWvDV3gv1DeZ6wnjIjOoZ9icBl8+AdsNQNGqRDanTaBcQGwsxHbV
F/3q9SdAkwxjqIpGxD7O
=Tyk6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to