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

feat: set transform to strip managedfields for informer #2149

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

vie-serendipity
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind feature

What this PR does / why we need it:

Reduce memory of yurt-manager and yurthub by stripping managedfields of objects. Because managed fields are often quite large, taking up around 30%. We usually don't need them, so we can strip them for memory efficiency.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

other Note

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 42.10526% with 11 lines in your changes missing coverage. Please review.

Project coverage is 58.97%. Comparing base (3713163) to head (1607a72).
Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
cmd/yurthub/app/config/config.go 57.14% 6 Missing ⚠️
pkg/util/util.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2149      +/-   ##
==========================================
+ Coverage   56.09%   58.97%   +2.87%     
==========================================
  Files         186      211      +25     
  Lines       18092    19026     +934     
==========================================
+ Hits        10149    11220    +1071     
+ Misses       6910     6721     -189     
- Partials     1033     1085      +52     
Flag Coverage Δ
unittests 58.97% <42.10%> (+2.87%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@rambohe-ch
Copy link
Member

@vie-serendipity Thank you for posting this pull request. I think it is very useful to reduce the RAM cost for yurt-manager and yurthub component. but serviceInformer is missed to SetTransform in the following place:

stf.serviceSynced = factory.Core().V1().Services().Informer().HasSynced

please add SetTransform for serviceInformer in Yurthub.

@vie-serendipity
Copy link
Member Author

/PTAL @rambohe-ch

Copy link

@rambohe-ch rambohe-ch added approved approved lgtm lgtm labels Oct 21, 2024
@rambohe-ch
Copy link
Member

/LGTM

@rambohe-ch rambohe-ch merged commit 0041df0 into openyurtio:master Oct 21, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants