I've got a very low traffic site running against Oracle. The monitors
show my ruby processes holding their database connections for the
maximum time configured, at which time they are "sniped". I am relying
on Rails to properly reconnect when necessary - I haven't seen any
errors indicating that it is *not* doing that.
I've been asked if Rails can be configured to do its own idle connection
management, closing them after a given period of time and then only
reconnecting when necessary.
I have no idea. Can somebody help me out? It's a small app and a small
number of connections, I think the ops guys just want to clean up their
monitoring report. But, still, it'd be good information to know.
There's nothing I know about that can get Rails to close connections. Perhaps your best bet would be to get the database to time out your connections relatively quickly. As long as your ActiveRecord verification_timeout is lower you shouldn't see any ill effects and you won't have connections hanging around for as long.
Here's probably more than you ever wanted to know of the subject.
If you are lazy check the status of the ticket (wontfix) and then skip
to the end of the comments. Then if still interested further click the
link in the last comment and see why sharing connections in pools in
Rails is not such a great idea.
At least that seems to be the case for now.
Here is another article on oracle.com that I found interesting. It
doesn't really cover the connections issues, but still have some
interesting stuff in there: