limit the number of concurrent executions of the ovs-vsctl command #3263
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.
What type of this PR
Examples of user facing changes:
add rate limiter to limit the number of concurrent executions of the ovs-vsctl command
Which issue(s) this PR fixes:
Fixes #3210
WHAT
🤖 Generated by Copilot at 85a248c
This pull request adds a new feature to rate limit ovs-vsctl commands in the
cniserver
module, using theovs
package and a new flag--ovs-vsctl-rate
. This improves the performance and stability of the OVS integration with kube-ovn. The pull request also updates the helm chart values and the deployment yamls to reflect the new flag and its default value.🤖 Generated by Copilot at 85a248c
HOW
🤖 Generated by Copilot at 85a248c
--ovs-vsctl-rate
to the ovncni daemonset container, which sets the rate limit of ovs-vsctl commands (link, link, link)OVS_VSCTL_RATE
to the helm chart values, which sets the default rate limit of ovs-vsctl commands to 100 per second (link)OVSVsctlRate
to theConfiguration
struct, which stores the rate limit of ovs-vsctl commands from the flag (link)--ovs-vsctl-rate
flag in theParseFlags
function of theconfig
module, and assign its value to theOVSVsctlRate
field (link, link)ovs
package to thecniserver
module, and call theUpdateOVSVsctlLimiter
function from theovs
package, which updates the rate limiter with the value from theOVSVsctlRate
field (link, link)context
andrate
packages to theovs
package, and define and initialize a global rate limiter with a default rate and burst of 100 per second (link, link, link)Exec
function of theovs
package, which executes ovs-vsctl commands, to use a context with a timeout of one second, and wait for the rate limiter to allow the execution (link)