Skip to content

[BUG] kube-ovn-cni consums lots of CPU when there are lots of subnets #4859

@oilbeater

Description

@oilbeater

Kube-OVN Version

v1.13.2 and before

Kubernetes Version

Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.32.0

Operation-system/Kernel Version

"Ubuntu 22.04.4 LTS"

Description

Related to #4849 and #4822 , when lots of subnets in a cluster, kube-ovn-cni can consume up to 80% of CPU.

This is related to the setIptables function which create count(subnet)*2 forward rules and check if rule exists every 10 seconds, which leads to a count(subnet)2count(subnet)*2 times filter.

Steps To Reproduce

  1. Create a cluster with 2 node and 250 subnets.
  2. Use top to see kube-ovn-daemon cpu usages

Current Behavior

Up to 80% CPU usage.

Expected Behavior

The CPU usage should be low under this load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingperformanceAnything that can make Kube-OVN fastersubnet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions