This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
bug 1434296: Use persistent DB connections #4644
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use persistent DB connections by setting
CONN_MAX_AGE
, defaulting to 60 seconds.AWS RDS limits the maximum connections as a factor of the instance size. Our current instance allows 1320 simultaneous connections. My estimate is that we use 1010 connections, and would be below this limit:
Another limiting factor is that MySQL will close idle connections, set by wait_timeout. It is currently set to
28800
, or 8 hours. TheCONN_MAX_AGE
should be below this number, and we may want to lower MySQL'swait_timeout
so that idle connections are released sooner. I believe this was much lower in SCL3, based on experience with interactive sessions, which made the defaultCONN_MAX_AGE
a better choice for that environment.@jgmize and @metadave may have feedback from an SRE perspective on this change.