I downloaded geoserver 1.6.3 (same goes for 1.6.4) war and oracle plugin.
Then i created an oracle data store and then feature type. All went well and
i was able to make requests (getmap, getfeature...)
But then i noticed (in database administration tool, network monitor) that
geoserver was making connections to the database very often (no SQLs, just
connect/disconnect (very simple packets) ). This happened every ~~20 seconds
even if GS was perfectly idle (no requests were being made). So i loaded
1.6.3 source into eclipse and debugged a little. I discovered where all this
connection to the database come from: the GenericObjectPool from
commons-dbcp-1.2.2.
The function org.geotools.data.jdbc.datasource.buildDefaultDataSource(...)
creates a datasource with hardcoded
dataSource.setMinEvictableIdleTimeMillis(1000 * 20);
So my question is: why is this propery set to 20 seconds? It bothers me
since it creates sooo many connections to the database (at least they get
closed properly). What would happen if i would to set this val to lets say
-1?
I downloaded geoserver 1.6.3 (same goes for 1.6.4) war and oracle plugin.
Then i created an oracle data store and then feature type. All went well and
i was able to make requests (getmap, getfeature...)
But then i noticed (in database administration tool, network monitor) that
geoserver was making connections to the database very often (no SQLs, just
connect/disconnect (very simple packets) ). This happened every ~~20 seconds
even if GS was perfectly idle (no requests were being made). So i loaded
1.6.3 source into eclipse and debugged a little. I discovered where all this
connection to the database come from: the GenericObjectPool from
commons-dbcp-1.2.2.
The function org.geotools.data.jdbc.datasource.buildDefaultDataSource(...) creates a datasource with hardcoded
dataSource.setMinEvictableIdleTimeMillis(1000 * 20);
So my question is: why is this propery set to 20 seconds? It bothers me
since it creates sooo many connections to the database (at least they get
closed properly). What would happen if i would to set this val to lets say
-1?
p.s.
In GS 1.5.x this wasn't happening.
My understanding of that setting was that it would not kill
connections from the pool when the number is equal to the minimum you set in the configuration page. The default is 4. Does the connection go
lower than this in your case?
In the Process Explorer i can see that the GS is connected to Oracle with 4
connections. And after a few minutes of running GS idle there have been over
200 "connect->send some small package to oracle->disconnect" actions. Is
that normal? (Over a day 1 GS may accumulate over 10.000 of this actions)
--
View this message in context: http://www.nabble.com/geoserver-1.6.3-4-and-connection-pool-tp18773300p18776335.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.
In the Process Explorer i can see that the GS is connected to Oracle with 4
connections. And after a few minutes of running GS idle there have been over
200 "connect->send some small package to oracle->disconnect" actions. Is
that normal? (Over a day 1 GS may accumulate over 10.000 of this actions)
Nope, that's not the intended behaviour I'd say. Can you open a jira issue about it?. I guess that DBCP is trying to make sure that all the
connections in the pool are ready to be used (as opposed to stale),
but the frequency of refreshes is quite a bit too high.
Can you suggest a better one? Like, 10 minutes?
I would like to avoid exposing all the connection parameters to the
user, there are a ton...