Skip to content
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

OCPBUGS-18676: ovnkube: set northd backoff-interval and use a single thread to save CPU #1990

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ spec:
if ! retry 20 "ipsec" "${OVN_NB_CTL} set nb_global . ipsec=${ipsec}"; then
exit 1
fi

# Tell northd to sleep a bit so it takes less CPU
if ! retry 20 "northd-backoff" "${OVN_NB_CTL} set nb_global . options:northd-backoff-interval-ms={{.OVN_NORTHD_BACKOFF_MS}}"; then
exit 1
fi
preStop:
exec:
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ spec:
if ! retry 20 "ipsec" "${OVN_NB_CTL} set nb_global . ipsec=${ipsec}"; then
exit 1
fi

# Tell northd to sleep a bit so it takes less CPU
if ! retry 20 "northd-backoff" "${OVN_NB_CTL} set nb_global . options:northd-backoff-interval-ms={{.OVN_NORTHD_BACKOFF_MS}}"; then
exit 1
fi
preStop:
exec:
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ spec:
if ! retry 20 "ipsec" "${OVN_NB_CTL} set nb_global . ipsec=${ipsec} options:ipsec_encapsulation=${ipsec_encapsulation}"; then
exit 1
fi

# Tell northd to sleep a bit so it takes less CPU
if ! retry 20 "northd-backoff" "${OVN_NB_CTL} set nb_global . options:northd-backoff-interval-ms={{.OVN_NORTHD_BACKOFF_MS}}"; then
exit 1
fi
preStop:
exec:
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ spec:
if ! retry 20 "ipsec" "${OVN_NB_CTL} set nb_global . ipsec=${ipsec} options:ipsec_encapsulation=${ipsec_encapsulation}"; then
exit 1
fi

# Tell northd to sleep a bit so it takes less CPU
if ! retry 20 "northd-backoff" "${OVN_NB_CTL} set nb_global . options:northd-backoff-interval-ms={{.OVN_NORTHD_BACKOFF_MS}}"; then
exit 1
fi
preStop:
exec:
command:
Expand Down
4 changes: 3 additions & 1 deletion pkg/network/ovn_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
nb_inactivity_probe = "60000"
klog.Infof("OVN_NB_INACTIVITY_PROBE env var is not defined. Using: %s", nb_inactivity_probe)
}
// Tell northd to sleep a bit to save CPU
data.Data["OVN_NORTHD_BACKOFF_MS"] = "300"

// Hypershift
data.Data["ManagementClusterName"] = names.ManagementClusterName
Expand Down Expand Up @@ -389,7 +391,7 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
// Less resource constrained clusters can use multiple threads
// in northd to improve network operation latency at the cost
// of a bit of CPU.
data.Data["NorthdThreads"] = 4
data.Data["NorthdThreads"] = 1
}

data.Data["OVN_MULTI_NETWORK_ENABLE"] = true
Expand Down