-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
perf(replay): reduce postgres queries in recording consumer using get_from_cache #77365
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #77365 +/- ##
===========================================
- Coverage 88.40% 78.18% -10.22%
===========================================
Files 2998 6959 +3961
Lines 186451 308986 +122535
Branches 30634 50556 +19922
===========================================
+ Hits 164826 241590 +76764
- Misses 15602 60936 +45334
- Partials 6023 6460 +437 |
@@ -294,8 +295,9 @@ def process_message(buffer: RecordingBuffer, message: bytes) -> None: | |||
else None | |||
) | |||
|
|||
project = Project.objects.get_from_cache(decoded_message["project_id"]) |
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.
How much memory will this consume?
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 the cache? I don't know. Got the inspiration from occurrence_consumer.py
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.
we already are usually caching the project for other places in ingest, so it probably won't be very much additional if any
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
@cmanallen pointed out the queries we make in _handle_breadcrumb, used to check feature flags and project options, could overload Postgres as we scale. To fix this we can do the query at the top-level and use
get_from_cache