-
Notifications
You must be signed in to change notification settings - Fork 3.4k
cilium, socklb: Terminate both UDP and TCP sockets #40304
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/test |
ysksuzuki
reviewed
Jul 2, 2025
Extend the socket termination logic and also terminate ongoing TCP connections when a backend goes down which allows for short feedback time since it does not require traffic to be radiated from clients to receive a RST from the remote. Note in terminateConnectionsToBackend we also remove the lb.ANY as they are removed by the reconciler in the new control plane once the maps have been populated with the new entries. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://github.com/cilium/cilium/pull/39800/files#r2122023563
Add a small comment explaining why we don't have the L4 proto as part of the lookup key. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
/test |
ysksuzuki
reviewed
Jul 7, 2025
9ee885f
to
d397b9e
Compare
Add a state filter to the iterator and skip TCP sockets which are in closing or time wait state. There is no need to spend time to iterate these. Technically, there is no harm since when the client app closes the socket and it goes into time wait state, then upon close the socket LB removes the socket from the revnat map in cil_sock_release.. but then again, no need to iterate through these. Suggested-by: Yusuke Suzuki <yusuke.suzuki@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
/test |
ysksuzuki
approved these changes
Jul 8, 2025
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!
borkmann
added a commit
that referenced
this pull request
Jul 11, 2025
Marcel reported that #40304 introduced a significant regression in the servicechurn scale test, causing almost 6x more CPU usage due to the cost of iterating sockets via netlink. Disable this by default for now until we find optimizations to make this less costly, for example, in-kernel socket iterators. Closes: #40463 Reported-by: Marcel Zieba <marcel.zieba@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann
added a commit
that referenced
this pull request
Jul 14, 2025
Marcel reported that #40304 introduced a significant regression in the servicechurn scale test, causing almost 6x more CPU usage due to the cost of iterating sockets via netlink. Disable this by default for now until we find optimizations to make this less costly, for example, in-kernel socket iterators. Closes: #40463 Reported-by: Marcel Zieba <marcel.zieba@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann
added a commit
that referenced
this pull request
Jul 14, 2025
Marcel reported that #40304 introduced a significant regression in the servicechurn scale test, causing almost 6x more CPU usage due to the cost of iterating sockets via netlink. Disable this by default for now until we find optimizations to make this less costly, for example, in-kernel socket iterators. Closes: #40463 Reported-by: Marcel Zieba <marcel.zieba@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann
added a commit
that referenced
this pull request
Jul 14, 2025
Marcel reported that #40304 introduced a significant regression in the servicechurn scale test, causing almost 6x more CPU usage due to the cost of iterating sockets via netlink. Disable this by default for now until we find optimizations to make this less costly, for example, in-kernel socket iterators. Closes: #40463 Reported-by: Marcel Zieba <marcel.zieba@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
rabelmervin
pushed a commit
to rabelmervin/cilium
that referenced
this pull request
Aug 18, 2025
Marcel reported that cilium#40304 introduced a significant regression in the servicechurn scale test, causing almost 6x more CPU usage due to the cost of iterating sockets via netlink. Disable this by default for now until we find optimizations to make this less costly, for example, in-kernel socket iterators. Closes: cilium#40463 Reported-by: Marcel Zieba <marcel.zieba@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
feature/socket-lb
Impacts the Socket-LB part of Cilium's kube-proxy replacement.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/misc
This PR makes changes that have no direct user impact.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(see commits)