On 9/16/21 07:28, Han Zhou wrote: > > > On Wed, Sep 1, 2021 at 5:42 AM Dumitru Ceara <[email protected] > <mailto:[email protected]>> 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 >> <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.
Yes, I agree. It was an attempt to optimize what I saw in the ovn-heater test. But, yes, such configuration seems to be far from reality. ovn-heater also configures ports for LBs now. So, let's drop this patch. > >> > >> > 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)? I had an idea, how to reduce computational complexity of this loop, but it seems pointless to actually implement, since this patch doesn't really cover real world scenarios and will not be accepted. Best regards, Ilya Maximets. > > Thanks, > Han > >> > >> > Signed-off-by: Ilya Maximets <[email protected] >> > <mailto:[email protected]>> >> > --- >> >> Regards, >> Dumitru _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
