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

Support expiring of DB connections #2351

Merged

Conversation

andy-paine
Copy link
Contributor

@andy-paine andy-paine commented Jun 24, 2021

A short explanation of the proposed change:

Support DB connections being expired after a certain time period (with a random delay)

An explanation of the use cases your change solves

We have long running CC processes and connections appear to be consuming and not freeing a lot of Postgres resources. We are hoping that by expiring connections after a certain (configurable) time limit, we can free up these resources before we see more damaging effects on the DB

It uses a builtin extension to Sequel which should hopefully be well understood and tested and just exposes some configuration parameters. Additionally, the extension should only end up being enabled for users who opt-in by specifying the timeout and optionally a random delay

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Add some config parameters which (only when provided) enable the
connection_expiration extension for Sequel. This allows connections to
be closed and recreated after a certain time period (with some random
delay to prevent the entire pool being recycled at once).

This should help DBs that are suffering from performance issues related
to extremely long running connections as the recycling should allow
resources associated with those connections to be freed
@sweinstein22
Copy link
Contributor

Looks good to me, thanks for the PR!

@sweinstein22 sweinstein22 merged commit 7400a3c into cloudfoundry:main Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants