-
1. Re: EAP 6 datasource pool connections do not idle - why?
wdfink Jan 3, 2015 5:39 PM (in response to rs3vans)1 of 1 people found this helpfulNot sure why the connections are opend, maybe if you use JPA or other persistence which check something at startup and open the connections.
The other thing is the idle-time ...
There is a change in one former version to keep the poo "hot", that mean all opened connections are used in a round-robin strategie, so lets assume you use a connection each minute and the idle time is 5 minutes it is possible that 6 connections are keept open.
This behaviour might become configurable in the future.
Does that make sense to you?
-
2. Re: EAP 6 datasource pool connections do not idle - why?
jaikiran Jan 4, 2015 12:36 AM (in response to rs3vans)From what you say it appears that every few seconds some threads use a connection from the pool to do some DB activity. Now I can't say (based on the limited info I know about your app) why the 14 connections were created in first place. But I'll take it that there was a genuine reason why those 14 connections were created. Now, when your application every few seconds asks for a connection, the pool can use some algorithm to decide which of the 14 connections to hand out to the application. It might so happen that the pool will return a different connection each time, which effectively means that over a period of 5 minutes, each of those 14 connections get used at least once, thus they never idle for 5 minutes straight.
Now, I don't know what the flush() operation is meant to do. Probably, clear all existing connections? Anyway, now when the application (continues) to ask for a connection every few seconds, the pool probably finds no existing connection and creates a new one and hands it out. It perhaps does it 2-3 times (and that depends on demand for connections from the application) and hence the 2-3 connections in the pool. It then just keep reusing those existing connections since I guess those are enough for what your application does.
-
3. Re: EAP 6 datasource pool connections do not idle - why?
rs3vans Jan 5, 2015 2:43 PM (in response to wdfink)This seems like a bad design - or is it just me? In the case of my application (frequent access to the DB, multiple times a minute), no connection will EVER idle...
-
4. Re: EAP 6 datasource pool connections do not idle - why?
jaikiran Jan 5, 2015 11:28 PM (in response to rs3vans)I don't know if in WildFly, there are ways to configure a different strategy for the managed connection pool. But the default strategy (ironjacamar/ManagedConnectionPoolFactory.java at 1.2 · ironjacamar/ironjacamar · GitHub) seems to be this one ironjacamar/SemaphoreArrayListManagedConnectionPool.java at 1.2 · ironjacamar/ironjacamar · GitHub which does this for connection selection ironjacamar/SemaphoreArrayListManagedConnectionPool.java at 1.2 · ironjacamar/ironjacamar · GitHub (i.e. round robin fashion) and I think that explains the behaviour you are seeing.
Ryan Evans wrote:
This seems like a bad design - or is it just me? In the case of my application (frequent access to the DB, multiple times a minute), no connection will EVER idle...
I don't think it's a bad design in general. Why let the connections idle if they have already been opened and are in the pool? I do understand that in your case perhaps 14 connections aren't needed for the repeated activity that the application is doing, but at some point they were needed or requested and are now in the pool. So I guess for cases like these, flush might be the right thing to do after all.