New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update connection pool library #558
Comments
Tell @eriksf |
I've experimented with replacing the default Postgres connection pool with https://github.com/brettwooldridge/HikariCP (there are lots of other options). This works much better and tolerates a restart of Postgres while the webapp is running. There are a lot more options for setting timeouts on connections. The properties to configure other connection pools are similar but different. We have a 'generic' system for reading database properties that works by reflection but doesn't easily extend to other drivers. If we want to provide options for the connection pool we'll need to think about the properties some more. We also may need to massage the old format properties so that mines don't have to make changes. |
I would recommend using HikariCP, it seems to be fast compared to many other connection pools and has all the options we need. If nobody objects I'll add this as an option. HikariCP is configured slightly differently to the existing postgres driver but I think we should massage the old format properties so only a single change is needed to the default.intermine.properties in each Mine.
|
Looks good! Let's develop this on a branch of beta. |
This is implemented but causing problems during the MalariaMine build, the build dies on the go source with the error that the database connection has been closed by user request. This is the connection being used by the CopyManager to write binary data to the database. The go source runs on it's own with an empty or populated database, the build succeeds if the go source is removed.
|
Having spent all day trying to debug why the new connection pool is closing connections unexpectedly I reverted to the old PGPoolingDataSource and got the same problem. So I think it may be an issue with the Postgres JDBC driver that I changed a couple of weeks ago. Have any builds been run successfully since the driver was updated? I'll try building my malariamine with a clean checkout of the beta branch next week. |
The beta branch works. Must be something else I've done. |
It's great to see progress on this issue. How close are we to getting some code to try out? We (Araport) have been talking to another group who has also had connection pool issues with their mine. |
The build issues are now fixed. The test for connection validity in I've updated the properties for Mines that are in the intermine repo, other Mines will need to make a change to minename/default.intermine.integrate.properties and minename/default.intermine.webapp.properties. For all databases configured, replace: with: and add: |
Need to set the minimum idle connections to be a small number (less than max connections) and provide option to override in properties |
It's not critical, but it would be nice to be able to override any of the properties: https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby. |
@sergiocontrino it should be possible to set any of the properties linked above, do you want to try it out? The code in Database.java alters some property names so the old configuration works but new properties should work fine. |
@sergiocontrino Can we close this ticket? Fixed by #699 |
@julie-sullivan : yes, i have only tested one property (minimumIdle), but in general adding a property should be just a matter of adding a line to the default properties file. |
Per @araport
The text was updated successfully, but these errors were encountered: