-
Notifications
You must be signed in to change notification settings - Fork 55
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
Postgresql parameters for db query investigations #5915
Conversation
3458116
to
1f95b38
Compare
3e61f02
to
b231251
Compare
abc1dfe
to
9ce8bef
Compare
resource "azurerm_postgresql_flexible_server_configuration" "log_min_duration_statement" { | ||
name = "log_min_duration_statement" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: this is in milliseconds, update this to a positive value in milliseconds to enable this logging |
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.
Question for my own learning: is there a good value to start off with when turning this on? Is every minute too much too little? 🤔
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.
The answer to this depends very much on the context, but I expect most queries to complete well under 1 second, so in most cases, setting it to something between 2 and 5 seconds would probably be fine.
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.
Left one non-blocking question! Thank you for adding docs on how to use this 😲
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.
Changes look good! Thanks for adding the documentation 😄
Quick note: Let's make sure we take a backup of the |
I'll deploy this and perform the manual DB updates on the week of July 26th. |
Kudos, SonarCloud Quality Gate passed! |
DEVOPS/DATABASE PULL REQUEST
Related Issue
Changes Proposed
pg_stat_statement
extension ( this will be installed manually )log_min_duration_statement
track_io_timing
pg_stat_statements.track
auto_explain.log_analyze
auto_explain.log_min_duration
auto_explain
to our databases list ofshared_preload_libraries
(previously waspg_cron,pg_stat_statements
)azure.extensions
to extensions we use. This was manually set up and had way more than we needed or used.Additional Information
Manual rollout steps:
pg_stat_statements
auto_explain
to our list ofshared_preload_libraries
I tried to add the
pg_stat_statements
extension with a backend migration, but our migrations user doesn't have permissionAll these parameters have been tested to work but have been disabled because these options can cause performance issues, so we only want to enable them when we believe we need them.
This is work to enable future devs to investigate query issues.
I'd like to run an exercise using these parameters to gather baseline data about our queries.
Wiki Page: https://github.com/CDCgov/prime-simplereport/wiki/Database-investigation-tools
Testing
How should reviewers verify this PR?
Check the terraform plan.
Checklist for Primary Reviewer
Database
Infrastructure
terraform-plan
job inside the "Terraform Checks" workflow run for this PR. Confirm that there are no unexpected changes!Security
Cloud
test
,dev
, orpentest
environment for verificationDocumentation