[Proxool-developer] Spurious connections caused by Prototyper's apparently wrong connectionCount
UNMAINTAINED!
Brought to you by:
billhorsman
From: Hrvoje N. <hn...@xe...> - 2005-09-30 09:45:19
|
We're having a problem deploying Proxool 0.8.3 with Oracle. The relevant settings are: jdbc-0.proxool.maximum-connection-count 30 jdbc-0.proxool.minimum-connection-count 2 jdbc-0.proxool.house-keeping-sleep-time 60000 jdbc-0.proxool.house-keeping-test-sql select * from dual jdbc-0.proxool.test-before-use true jdbc-0.proxool.maximum-active-time 240000 jdbc-0.proxool.maximum-connection-lifetime 1800000 ... So proxool should maintain no less than 2 and no more than 30 connections to the database. But, over time, it appears that proxool opens more connections, eventually exhausting Oracle's SESSIONS_PER_USER limit. All the connections are usable and the additional ones are opened at times when there there are other usable connections available. For example, when creating the 33rd connection, Proxool's log contains: 2005-09-27 01:36:57 DEBUG [ConnectionPool] [Thread-18]: 1003445 -000257 (04/32/00) - Connection #1646 tested: OK 2005-09-27 01:36:57 DEBUG [chatdate] [Prototyper]: 1003446 -000257 (04/33/00) - Connection #1666 created to achieve minimum of 2 = AVAILABLE 04/32/00 shows that ConnectionPool is aware that it has a total of 32 connections, 28 of which are available, and yet the Prototyper thinks it has less than two open connections and is trying to open more to make up for the perceived shortage. Examining established connections with netstat shows that ConnectionPool's numbers are correct. A possible cause for this problem was outlined by Peter Radics in his message from Jan 11th, http://tinyurl.com/7eb77/. He noticed that each time HouseKeeper sweeps a connection that has been active for too long, connectionCount gets decremented twice. However, no one responded to that message and I don't know if this problem has been fixed in the development sources. I'm reluctant to apply his patch unchanged because it feels like a kludge and because the last part contains an increment I don't understand. Another problem I noticed with the Prototyper code is that it lacks synchronization when decrementing connectionCount. That cannot be good, although it is probably not the cause of this particular problem. Are you aware of a fix or a workaround for this? Thanks for your help. |