-
Notifications
You must be signed in to change notification settings - Fork 49
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
Trace memory usage with logging #2708
Trace memory usage with logging #2708
Conversation
Build failed. ✔️ pre-commit SUCCESS in 1m 51s |
Build failed. ✔️ pre-commit SUCCESS in 1m 47s |
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.
otherwise looks good!
def log_memory_stats(self) -> None: | ||
gc.collect() | ||
memory_usage = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss | ||
logger.error(f"Memory usage: {memory_usage} (kb)") |
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.
do we need this as error level? It will end up in Sentry iirc
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.
No, I forgot to change it...
93cc3a4
to
57f514f
Compare
Build failed. ✔️ pre-commit SUCCESS in 1m 47s |
57f514f
to
7b2593d
Compare
Build failed. ✔️ pre-commit SUCCESS in 1m 50s |
7b2593d
to
9509218
Compare
Build failed. ✔️ pre-commit SUCCESS in 1m 51s |
recheck |
Co-authored-by: Matej Focko <[email protected]>
9509218
to
b61b539
Compare
recheck |
Build succeeded. ✔️ pre-commit SUCCESS in 1m 57s |
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 49s |
Sadly
py-spy
was only a time profiler and I wasn't able to find something that does not need changes in the code.I followed mainly this guide and this celery issue suggestions.
Deep profiling will be done just in stg, quicker resource check also in prod.