-
Notifications
You must be signed in to change notification settings - Fork 888
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: optimize list operation for resourcetracker and applicationrevision #5572
Conversation
ac8e6af
to
2f556db
Compare
Codecov ReportBase: 44.28% // Head: 46.67% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5572 +/- ##
==========================================
+ Coverage 44.28% 46.67% +2.38%
==========================================
Files 308 254 -54
Lines 47795 43438 -4357
==========================================
- Hits 21167 20274 -893
+ Misses 23900 20870 -3030
+ Partials 2728 2294 -434
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
2f556db
to
6f2be33
Compare
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.
please make sure the compatiblity for upgrade case
Compatibility verified. |
6f2be33
to
44b4872
Compare
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
44b4872
to
f80777c
Compare
|
Backport failed for Please cherry-pick the changes locally. git fetch origin release-1.6
git worktree add -d .worktree/backport-5572-to-release-1.6 origin/release-1.6
cd .worktree/backport-5572-to-release-1.6
git checkout -b backport-5572-to-release-1.6
ancref=$(git merge-base af10f1122512dd542da9f68da5606d11a18a9867 f80777c4a20c539594c400a8e59ada31ef4eba25)
git cherry-pick -x $ancref..f80777c4a20c539594c400a8e59ada31ef4eba25 |
|
Backport failed for Please cherry-pick the changes locally. git fetch origin release-1.7
git worktree add -d .worktree/backport-5572-to-release-1.7 origin/release-1.7
cd .worktree/backport-5572-to-release-1.7
git checkout -b backport-5572-to-release-1.7
ancref=$(git merge-base af10f1122512dd542da9f68da5606d11a18a9867 f80777c4a20c539594c400a8e59ada31ef4eba25)
git cherry-pick -x $ancref..f80777c4a20c539594c400a8e59ada31ef4eba25 |
Description of your changes
When controller handles a large amount of applications, like 50k, the informer cache will hold lots of ResourceTracker and ApplicationRevisions. This will make the list operation on informer cache slow and take lots of CPU.
With this optimization, the cache list time consumption can be reduced from 40ms to 25us, and therefore reduce the overall average reconcile time by 50% under the load-testing settings.
The ResourceTracker list operation is introduced since v1.2 but is lost in v1.6 after the code refactor. This PR fixes it and add additional ApplicationRevision list op optimization for it additionally.
The list op optimization is reached by adding field indexer for these two types of resources.
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer