-
Notifications
You must be signed in to change notification settings - Fork 363
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
bugfix: filter repeated resources and optimize memory usage. #4454
Conversation
@qicz thanks for picking this one up, its worth investigating why this happening before working around it by using a set |
we need some test to guratee this |
for my analysis, the gateway/internal/provider/kubernetes/controller.go Lines 434 to 455 in aab669d
logging: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4454 +/- ##
==========================================
- Coverage 65.97% 65.88% -0.10%
==========================================
Files 203 204 +1
Lines 31154 31234 +80
==========================================
+ Hits 20554 20578 +24
- Misses 9415 9475 +60
+ Partials 1185 1181 -4 ☔ View full report in Codecov by Sentry. |
abf1930
to
e73cff7
Compare
ah thanks for pointing to the controller/provider code, it looks like since the service was referenced twice, we added the corresponding endpoint slice twice. The fix in this PR is not going to work since it has visibility into a single EndpointSlice We can either fix this in the provider or in the gateway api layer |
I 'll fix this in gateway API layer |
12032a1
to
414c3b0
Compare
22c9bed
to
55d5a5a
Compare
c15548d
to
b1da953
Compare
c262a85
to
7a59d5e
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.
thanks for the fix @qicz, now the mem usage decrease dramatically !
ebd3517
to
295a44b
Compare
looks like we are already doing something similar in the provider layer using this structure to ensure deduplication, can we implement this there instead ? |
They are similar,but cache used in controller and translate, IMO should in gateway layer resource pkg. resourcemap just for controller @arkodg |
since we already have an existing way to do this, prefer the provider approach to reduce code complexity |
you mean reuse resourcemap struct? or reuse resourcemap set properties? @arkodg |
create an addition field within |
@qicz my suggestion is to solve the problem in the provider package similar to what we are doing for other resources |
1302a4c
to
93bc44b
Compare
Signed-off-by: qicz <[email protected]>
cd6a818
to
79d7928
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.
LGTM thanks !
great to see the massive drop in mem usage
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #4395 and optimize for #4181
before:
after