[ovs-dev] [PATCH ovn] ovn-northd: Don't generate identical flows for same LBs with different protocol.

Han Zhou hzhou at ovn.org
Thu Sep 16 05:28:01 UTC 2021


On Wed, Sep 1, 2021 at 5:42 AM Dumitru Ceara <dceara at redhat.com> wrote:
>
> Hi Ilya,
>
> On 8/27/21 5:24 PM, Ilya Maximets wrote:
> > It's common for CMS (e.g., ovn-kubernetes) to create 3 identical load
> > balancers, one per protocol (tcp, udp, sctp).  However, if VIPs of
> > these load balancers has no ports specified (!vip_port), northd will
> > generate identical logical flows for them.  2 of 3 such flows will be
> > just discarded, so it's better to not build them form the beginning.
>
> I don't think this is accurate; AFAIK ovn-kubernetes will not configure
> load balancer VIPs without specifying the port.
>
> >
> > For example, in an ovn-heater's 120 node density-heavy scenario we
> > have 3 load balancers with 15K VIPs in each.  One for tcp, one for
> > udp and one for sctp.  In this case, ovn-northd generates 26M of
> > logical flows in total.  ~7.5M of them are flows for a single load
> > balancer.  2 * 7.5M = 15M are identical to the first 7.5M and just
> > discarded.
>
> The way ovn-heater was configuring VIPs was wrong.  I opened a PR to fix
> that:
>
> https://github.com/dceara/ovn-heater/pull/75
>
> >
> > Let's find all these identical load balancers and skip while building
> > logical flows.  With this change, 15M of redundant logical flows are
> > not generated saving ~1.5 seconds of the CPU time per run.
>
> In conclusion I'm not so sure the impact will be as noticeable in a real
> ovn-kubernetes deployment.
>

I agree with Dumitru that maybe it's not worth optimizing OVN for
unrealistic use cases. If someone configures LBs that way (with L4 protocol
specified but no L4 ports), shall we consider it a misconfiguration and let
the user be responsible for the unnecessary overhead? We could add
documents to advise users not to do such things.
On the other hand, if users do have ports added (i.e. correcting the
misconfiguration), this change would not help anyway.

> >
> > Comparison function and the loop looks heavy, but in testing it takes
> > only a few milliseconds on these large load balancers.

The O(n^2) loop does look heavy. Would it be slow when there are a large
number of LBs (each may have small number of VIPs)?

Thanks,
Han

> >
> > Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
> > ---
>
> Regards,
> Dumitru
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list