-
Notifications
You must be signed in to change notification settings - Fork 282
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
feat: Relayer heap profiling #4180
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4180 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 1 1
Lines 14 14
=====================================
Misses 14 14
|
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.
nice 🔥
Description
During the scalability audit we've identified relayer memory usage as a cause of concern. This PR runs the profiler each time e2e is run and outputs a report called
dhat-heap.json
in the current dir. That file can be visualised with a dhat viewer, such as the one hosted by the author here.It adds a conditionally compiled heap memory profiler (dhat-rs), which is only included when both the
memory-profiling
feature is enabled and thememory-profiling
cargo profile is used.The report can order the profiling results by total lifetime allocated bytes, peak allocated bytes, total allocation count, etc. Below is the result of sorting by total lifetime allocated bytes, which reveals that the biggest memory hogs are the hook indexing channel senders (one per origin chain), taking up 100+ MB. Its size can most likely be reduced from 1M to 1k.
Drive-by changes
Adds the remaining IDs in the channel as a field to the hook indexing log, to know if it's safe to lower the channel size.
Related issues
Backward compatibility
Yes, since everything is conditionally compiled / isolated in a new cargo profile.
Testing
Manual