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
optimize watch-cache getlist #116327
optimize watch-cache getlist #116327
Conversation
Skipping CI for Draft Pull Request. |
40dcba9
to
ca8a72f
Compare
cc @wojtek-t |
pred := storage.SelectionPredicate{ | ||
Label: labels.Everything(), | ||
Field: fields.Everything(), | ||
} |
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.
This benchmark assumes that we actually return all objects.
The other extremely important usecase is where a bunch of objects are actually filtered out (e.g. Kubelet listing its own pods).
Can you add a second benchmark that will simulate this one (i.e. only say 50 out of those 50,000 pods are being returned)?
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.
Your prompt reply is much appreciated 😄! Use-cases have been added and I provided the latest benchmark results at #116327 (comment). PTAL
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.
Fixed, PTAL @wojtek-t
/triage accepted |
ca8a72f
to
3073b0c
Compare
/ping @lavalamp |
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go
Outdated
Show resolved
Hide resolved
- add comment to explain why we need to apply for a slice of runtime.Object instead of making a slice of ListObject.Items directly.
/retest |
/lgtm Thank you! (this should merge when we open up for 1.28) |
LGTM label has been added. Git tree hash: e7fd8ed2f9067a86cc64347e394289cd6ade3bc1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, sxllwx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ok,Thank you for your help, it has been a pleasure to work with you. |
Sorry for delay - this LGTM too. /lgtm |
* ftr(watch-cache): add benchmarks * ftr(kube-apiserver): faster watch-cache getlist * refine: testcase name * - refine var name make it easier to convey meaning - add comment to explain why we need to apply for a slice of runtime.Object instead of making a slice of ListObject.Items directly.
I want to add a release-note here. hope it's not too late |
* ftr(watch-cache): add benchmarks * ftr(kube-apiserver): faster watch-cache getlist * refine: testcase name * - refine var name make it easier to convey meaning - add comment to explain why we need to apply for a slice of runtime.Object instead of making a slice of ListObject.Items directly.
What type of PR is this?
What this PR does / why we need it:
Faster watch-cache get-list.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
In order to facilitate verification, I split it into two commits:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: