-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow ReplicaSet and Job metadata generators to use partial meta objects #109
Conversation
088bf6d
to
b910b89
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! eager to see the impact of using PartialObjectMetadata on the mem footprint
We only use metadata from Jobs and ReplicaSets, but require that full resources are supplied. This change relaxes this requirement, allowing PartialObjectMetadata resources to be used. This allows callers to use metadata informers and avoid having to receive and serialize non-metadata updates from the API Server.
b910b89
to
30ded63
Compare
💚 Build Succeeded
History
|
@swiatekm Is there some way for you to quantify this impact (before vs. after), perhaps as a function of the number of ReplicaSets and Jobs? |
Hard to do so in general, because the size of the resource in memory can heavily depend on user-provided metadata. For example, it's possible to set multiple annotations of up to 256kb each on it. In a test cluster I saw agent use 80% less memory on ReplicaSets specifically, but in real production clusters I'd expect the gains to be more substantial. If we're talking about the total agent memory consumption, then that obviously depends on what inputs are enabled, but with the standalone Kubernetes manifest we provide, in a test cluster of 3 Nodes, with ~7500 ReplicaSets, I saw a reduction of ~120 Mb. You can see more details here: elastic/elastic-agent#5623. |
We only use metadata from Jobs and ReplicaSets, but require that full resources are supplied. This change relaxes this requirement, allowing PartialObjectMetadata resources to be used. This allows callers to use metadata informers and avoid having to receive and deserialize non-metadata updates from the API Server.
See elastic/elastic-agent#5580 for an example of how this could be used. I'm planning to add the metadata informer from that PR to this library as well. Together, these will allow us to greatly reduce memory used for processing and storing ReplicaSets and Jobs in beats and elastic-agent.
This is will help elastic/elastic-agent#5580 and elastic/elastic-agent#4729 specifically, and elastic/elastic-agent#3801 in general.