mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-25 17:36:23 -04:00
GetAllLocalAddressesExcept previously iterated over net.Interfaces() and called iface.Addrs() for each interface. iface.Addrs() internally performs a full RTM_GETADDR netlink dump for the entire node and then filters in user space. With many interfaces and many addresses (for example tens of thousands of ClusterIPs bound to kube-ipvs0) the cost is O(N_interfaces * N_addresses) and dominates syncProxyRules latency. This change replaces the per-interface loop with a single netlink.AddrList(nil, unix.AF_UNSPEC) call that dumps all addresses on the node in one RTM_GETADDR request, then filters by LinkIndex in user space. This makes the call O(N_addresses) and avoids the per-interface fan-out. On a production node with 251 interfaces and 19757 addresses, this reduces GetAllLocalAddressesExcept latency from 34.8s to 60ms (~705x). |
||
|---|---|---|
| .. | ||
| apis | ||
| config | ||
| conntrack | ||
| healthcheck | ||
| iptables | ||
| ipvs | ||
| kubemark | ||
| metaproxier | ||
| metrics | ||
| nftables | ||
| runner | ||
| util | ||
| winkernel | ||
| doc.go | ||
| endpoint.go | ||
| endpointschangetracker.go | ||
| endpointschangetracker_test.go | ||
| endpointslicecache.go | ||
| endpointslicecache_test.go | ||
| node.go | ||
| node_test.go | ||
| OWNERS | ||
| servicechangetracker.go | ||
| servicechangetracker_test.go | ||
| serviceport.go | ||
| topology.go | ||
| topology_test.go | ||
| types.go | ||