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

Significantly reduce shared informer memory usage #4012

Merged
merged 3 commits into from Nov 23, 2023

Conversation

dcbw
Copy link
Contributor

@dcbw dcbw commented Nov 15, 2023

Kubernetes client-go v0.29 (not yet released) adds a WithTransform() option to shared informer factories that lets callers modify objects before they are added to the cache. Since we cache lots of objects (every pod, service, endpoint, node, etc) we can nil out a bunch of fields we don't care about, and save a lot of memory. This reduces ovn-kube memory usage by about 30% at high scale (250 nodes, 60,000 pods, 30,000 services)

The only catch is we need to carry a client-go patch until we can bump to v0.29 next year. But it's really small.

@coveralls
Copy link

coveralls commented Nov 15, 2023

Coverage Status

coverage: 50.464% (+0.008%) from 50.456%
when pulling e17e8f2 on dcbw:save-informer-memory
into e90a04d on ovn-org:master.

@npinaeva
Copy link
Member

makes sense to me, but e2es need some attention

@dcbw
Copy link
Contributor Author

dcbw commented Nov 21, 2023

@npinaeva CI look better now?

linxiulei and others added 3 commits November 22, 2023 11:40
kubernetes/kubernetes#118455

Kubernetes-commit: c86f562f29b6b7498ea962d2ac596e6d26ecd723
Kubernetes-commit: 9c4651bd0479b84f5e5913649207476717f3f13e

Signed-off-by: Eric Lin <exlin@google.com>
We don't care about them, so why cache them and use a ton
of memory.

Inspired by kubernetes/kubernetes#118455

Signed-off-by: Dan Williams <dcbw@redhat.com>
…thRetry() function

Signed-off-by: Dan Williams <dcbw@redhat.com>
@dcbw
Copy link
Contributor Author

dcbw commented Nov 22, 2023

@npinaeva CI all green on first try now

Copy link
Member

@npinaeva npinaeva left a comment

Choose a reason for hiding this comment

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

let's save some memory!

@openshift-merge-robot
Copy link

Fix included in accepted release 4.15.0-0.nightly-2023-12-02-123536

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.

None yet

5 participants