Skip to content
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

[HelixTask] Reduce memory footprint to minimize GC pauses #2657

Merged
merged 9 commits into from
Nov 28, 2023

Conversation

snalli
Copy link
Contributor

@snalli snalli commented Nov 27, 2023

The frontends are timing out connecting to servers because servers are busy with GC. The GC pause is 3-second long because JVM is busy releasing memory consumed by StatsAggregator. The aggregator fetches results for all accounts, containers and partitions to store it in a giant map, which consumes close to 10GB of heap.

This patch fixes this issue by not buffering those stats. Instead it fetches each stat and immediately processes it without saving it for further use.

@snalli snalli requested a review from ankagrawal November 27, 2023 23:10
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2023

Codecov Report

Attention: 64 lines in your changes are missing coverage. Please review.

Comparison is base (fdc4ec2) 32.40% compared to head (4a4d5c2) 33.36%.
Report is 2 commits behind head on master.

Files Patch % Lines
...clustermap/PartitionClassStorageStatsIterator.java 0.00% 16 Missing ⚠️
.../ambry/clustermap/AccountStorageStatsIterator.java 0.00% 14 Missing ⚠️
...ithub/ambry/clustermap/MySqlClusterAggregator.java 0.00% 12 Missing ⚠️
...in/java/com/github/ambry/clustermap/TaskUtils.java 0.00% 10 Missing ⚠️
.../ambry/accountstats/InmemoryAccountStatsStore.java 27.27% 8 Missing ⚠️
...ub/ambry/clustermap/MySqlReportAggregatorTask.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2657      +/-   ##
============================================
+ Coverage     32.40%   33.36%   +0.95%     
- Complexity     4460     5138     +678     
============================================
  Files           806      809       +3     
  Lines         65491    65515      +24     
  Branches       7994     7994              
============================================
+ Hits          21225    21857     +632     
+ Misses        42031    41964      -67     
+ Partials       2235     1694     -541     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@justinlin-linkedin justinlin-linkedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM , just some minor comments

@justinlin-linkedin
Copy link
Collaborator

Could you please change the title to be more aligned with your change?

@snalli snalli changed the title Fix ConnectionTimeoutException [HelixTask] Reduce memory footprint to minimize GC pauses Nov 28, 2023
@snalli snalli merged commit e140579 into master Nov 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants