-
Notifications
You must be signed in to change notification settings - Fork 364
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
Trim images in Node objects to reduce memory footprint #6351
Conversation
The images field is of no use to Antrea while it could be a long list and take quite some space as antrea-controller and all antrea-agent instances cache all Nodes in the cluster. Trimming images can release nearly 10m memory from each Antrea process in a cluster of 1k Nodes, saving 10G memory in total. Signed-off-by: Quan Tian <[email protected]>
/test-all |
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
if !ok { | ||
return obj, nil | ||
} | ||
node.Status.Images = nil |
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.
is node.Status.NodeInfo
safe to remove as well?
is it insignificant compared to node.Status.Images
?
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.
It's safe to remove it. However, the field is not a pointer but a struct containing 10 strings, while each string is not too long. To trim them, the simplest code is to override it with a new struct, which could increase heap usage 160 bytes per object temporarily, whille overriding one field per line seems not very worth as each field is not long: the total data size in a typical nodeInfo is about 200 bytes.
nodeInfo:
architecture: amd64
bootID: 56ae4e38-a8b1-4657-8b8a-86a75623926e
containerRuntimeVersion: containerd://1.7.15
kernelVersion: 5.4.0-169-generic
kubeProxyVersion: v1.30.0
kubeletVersion: v1.30.0
machineID: d61012698a3649178b7f74d6f57fc965
operatingSystem: linux
osImage: Debian GNU/Linux 12 (bookworm)
systemUUID: d43097b6-a686-420f-b033-fd5c15392e4d
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.
Good point, thanks for the detailed answer
The images field is of no use to Antrea while it could be a long list and take quite some space as antrea-controller and all antrea-agent instances cache all Nodes in the cluster.
Trimming images can release nearly 10m memory from each Antrea process in a cluster of 1k Nodes, saving 10G memory in total.