On Thu, Apr 20, 2017 at 11:03 PM, Han Zhou <[email protected]> wrote: > > As discussed in [1], what the incremental processing code > actually accomplished was that the ovn-controller would > be "quiet" and not burn CPU when things weren't changing. > This patch set recreates this state by calculating whether > changes have occured that would require a full calculation > to be performed. It does this by persisting a copy of > the localvif_to_ofport and tunnel information in the > controller module, rather than in the physical.c module > as was the case with previous commits. > > Performance improved extremely in below test scenario: > > - 1 lswitch with 10 lports bound locally > - Each lport has an ingress ACL, referencing the same address-set > - The address-set has 10,000 IPv4 addresses > > For each IP address in the address-set, there will be 3 > OpenFlow rules generated for each ACL. So the total number > of rules is 300k+. > > Without the patch, it takes 50+ minutes to install all the > rules to ovs-vswitchd. > > With the patch, it takes 20 seconds to install all the rules > to ovs-vswitchd. > > The reason is that the large number of rules are sent to > ovs-vswitchd gradually in many iterations of ovn-controller > main loop. Without the patch, cpu cycles are wasted in > lflow_run to re-processing the large address set in every > main loop iteration. With the patch, lflow_run is not > executed in most iterations because there is no change of > input. > > [1] https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/078272.html > > Signed-off-by: Ryan Moats <[email protected]> > Signed-off-by: Han Zhou <[email protected]> > --- > > Notes: > v4->v5: > - Based on the old patch from Ryan Moats and rebased to current master. > - Fixed a problem: when there are large number of flows being installed > to OVS, changes made at the same time to SB DB (e.g. lflows) or > physical mappings won't get processed until there are new changes to > trigger processing, which may not happen at all. The root cause is > ofctrl_put can abort temporarily if there are in-flight messages, > which causes last round of flow updates got lost.
I just realized that the ofctrl_can_put logic alone is able to achieve the performance improvement, so I split it to 2 patches in a series for the first (simpler) one to be reviewed/merged faster probably. The quiet mode change depends on the first one to behave correctly. 1) https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/331286.html 2) https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/331287.html Thanks, Han _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
