Unused Timeout: This is how long Websphere will keep a connection idle in the pool. That is, say there is a sudden demand for connections and the total # of connections in the pool climbs to say 100. Now, there is a decrease in web traffic. The connections in use at any time are now about 50 and stay there for a while. With the default timeout of 1800, Websphere will wait a half hour before releasing the excess 50 connections.
Another way to look at it is that if any one connection is in the pool and idle for 1800 seconds or 30 minutes -- it will be closed and removed from the pool.
I think 30 minutes is excessive. I recommend 300 seconds or five minutes as a starting point. Adjust depending on your application and other constraints. Closing the connection will ensure all associated result sets etc. will get cleared and Garbage Collected. The db server will be able to clear up the memory at its end as well.
If you have multiple applications or application servers (as in a cluster) connecting to the same database, this may result in a lower maximum # of connections in use at the database server over a given period of time. This would provide relief to your database server and, if it is licensed by max # of connections, may save you money as well.
There are two drawbacks to these connections being closed. It will clear the 'Prepared Statement Cache' and there will be some overhead of re-acquiring this connection if and when demand rises again. So you don't want to set this to too low a value.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment