Skip to content
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

Tune db connection pool to more diligently reap idle and abandoned connections #33

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

ztaylor54
Copy link
Collaborator

This should address potential memory leaks in workers' connection pools. According to the Tomcat docs, these changes to the connection pool should have the following behavior:

Every 30 seconds, an eviction check will be run. Threads that have been idle for more than 60 seconds are eligible for eviction, should they fail validation.

Connections that are considered abandoned will be removed. A connection that has been borrowed for more than 2 minutes without being returned is assumed abandoned and is closed. CWS previously only logged such occurrences.

NOTE: removeAbandonedTimeout should be at least as long as the longest query we expect to run in CWS. In the past, this was the console summary statistics, which could run for much longer than 2 minutes. This has since been remedied, leaving 2 minutes as a generous timeout on connections borrowed from the connection pool.

@ztaylor54 ztaylor54 added the enhancement New feature or request label Mar 14, 2021
Copy link
Contributor

@galenatjpl galenatjpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some more real-world testing will be applied to this, but this change makes sense, and seems to fill a current gap in the configuration, with respect to removing abandoned connections.

@ztaylor54 ztaylor54 merged commit 1b467fc into main Mar 16, 2021
@ztaylor54 ztaylor54 deleted the db-tuning branch March 16, 2021 00:39
@ztaylor54
Copy link
Collaborator Author

Will continue to keep an eye on this change & see how it affects performance.

We should also consider taking HikariCP for a spin, as it is recommended by Camunda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants