Only detecting stale connections for UDP ports in kube-proxy.

The detectStaleConnections function in kube-proxy is very expensive in
terms of CPU utilization. The results of this function are only actually
used for UDP ports. This adds a protocol attribute to ServicePortName to
make it simple to only run this function for UDP connections. For
clusters with primarily TCP connections this can improve kube-proxy
performance by 2x.
This commit is contained in:
Rob Scott
2019-09-24 17:41:50 -07:00
parent 45f7f70479
commit af56f25797
9 changed files with 781 additions and 654 deletions

View File

@@ -43,7 +43,8 @@ type Provider interface {
// identifier for a load-balanced service.
type ServicePortName struct {
types.NamespacedName
Port string
Port string
Protocol v1.Protocol
}
func (spn ServicePortName) String() string {