-
Notifications
You must be signed in to change notification settings - Fork 1
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
BCDA-7655: Update SSAS for resiliency / connection management improvements. #152
Conversation
|
Sure thing, adding @gsf as well for a quick look-see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
@@ -31,9 +31,10 @@ func createDB() (*gorm.DB, error) { | |||
|
|||
// TODO: Allow connection settings to be configured by env vars | |||
// https://jira.cms.gov/browse/BCDA-7109 | |||
sqlDB.SetMaxOpenConns(40) | |||
sqlDB.SetMaxOpenConns(60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, I checked production and the database-level max connections is pretty high:
bcda=> show max_connections;
max_connections
-----------------
1709
sqlDB.SetMaxIdleConns(40) | ||
sqlDB.SetConnMaxLifetime(time.Duration(5) * time.Minute) | ||
sqlDB.SetConnMaxIdleTime(time.Duration(30) * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize this was a method, thank you!
🎫 Ticket
https://jira.cms.gov/browse/BCDA-7655
🛠 Changes
Updated maximum number of DB connections from 40 -> 60
Added idle connection timeout
Updated from go 1.18-> 1.19 concurrent with updating to latest versions of dependencies.
Removed ioutil references (deprecation caused issues going from 1.18-> 1.19)
ℹ️ Context for reviewers
There are inefficiencies in connection handling for the go postgres / sql libraries that we use, leading to issues with stability. While bcda-app is locked to an old version of pgx due to the queuing package used, there’s no such restriction for SSAS, so we can use the latest version of the packages (with connection pooling improvements).
✅ Acceptance Validation
Manual verification of information in the commit, unit tests pass.
🔒 Security Implications
If any security implications apply, add Jason Ashbaugh (GitHub username: StewGoin) as a reviewer and do not merge this PR without his approval.