[ovs-git] [ovn-org/ovn] deec97: northd: optimize build_lb_rules routine

Lorenzo Bianconi noreply at github.com
Fri Aug 27 18:28:18 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: deec97274ab82bc5f13754c515025d5f86545ef3
      https://github.com/ovn-org/ovn/commit/deec97274ab82bc5f13754c515025d5f86545ef3
  Author: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
  Date:   2021-08-27 (Fri, 27 Aug 2021)

  Changed paths:
    M northd/ovn-northd.c

  Log Message:
  -----------
  northd: optimize build_lb_rules routine

Introduce ovn_lflow_add_at_with_hash to use a precomputed hash if not
dependent on the logical flow.
Introduce ovn_dp_group_add_with_reference routine to update the
dapath_group with the datapath pointer without run a lflow lookup.
Optimize build_lb_rules routine relying on ovn_lflow_add_at_with_hash
and ovn_dp_group_add_with_reference since they do not depend on the
datapath if meter is NULL.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
Acked-by: Mark D. Gray <mark.d.gray at redhat.com>
Signed-off-by: Mark Michelson <mmichels at redhat.com>


  Commit: 08958855dcf9b05fe860409d425955420f213156
      https://github.com/ovn-org/ovn/commit/08958855dcf9b05fe860409d425955420f213156
  Author: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
  Date:   2021-08-27 (Fri, 27 Aug 2021)

  Changed paths:
    M northd/ovn-northd.c

  Log Message:
  -----------
  norhd: optimize build_lrouter_defrag_flows_for_lb

Similar to build_lb_rules(), precompute hash and lflow pointer in
build_lrouter_defrag_flows_for_lb routine since they do not depend on
datapath updating datapath group. Using this approach we can reduce
ovn-northd loop time of ~1s running an ovnnb_db from production
environment:

ovn-master:
-----------
Statistics for 'ovnnb_db_run'
  Total samples: 37
  Maximum: 12656 msec
  Minimum: 12276 msec
  95th percentile: 12557.000000 msec
  Short term average: 12475.213654 msec
  Long term average: 12336.498446 msec

build_lb_rules + build_lrouter_defrag_flows_for_lb:
---------------------------------------------------
Statistics for 'ovnnb_db_run'
  Total samples: 37
  Maximum: 11266 msec
  Minimum: 11039 msec
  95th percentile: 11194.000000 msec
  Short term average: 11145.945629 msec
  Long term average: 11075.628051 msec

ovn-nbctl lr-list | wc -l
121
ovn-nbctl ls-list | wc -l
241
ovn-nbctl lb-list | wc -l
47077
ovn-sbctl dump-flows |wc -l
9852935

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
Acked-by: Mark D. Gray <mark.d.gray at redhat.com>
Signed-off-by: Mark Michelson <mmichels at redhat.com>


  Commit: b3af6c8c442d824ad7646350adab40adb2d646f0
      https://github.com/ovn-org/ovn/commit/b3af6c8c442d824ad7646350adab40adb2d646f0
  Author: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
  Date:   2021-08-27 (Fri, 27 Aug 2021)

  Changed paths:
    M northd/ovn-northd.c

  Log Message:
  -----------
  northd: refactor unreachable IPs lb flows

Refactor unreachable IPs for vip load-balancers inverting the logic used
during the lb flow creation in order to visit lb first and then related
datapath/ovn_ports. Rely on ovn_lflow_add_at_with_hash and
ovn_dp_group_add_with_reference in build_lflows_for_unreachable_vips.
Introduce ovs_list in ovn_datapath to link ovn ports on a given
datapath.
Using this approach we can reduce ovn-northd loop time of ~3s running an
ovnnb_db from production environment:

ovn-master:
-----------
Statistics for 'ovnnb_db_run'
  Total samples: 37
  Maximum: 12656 msec
  Minimum: 12276 msec
  95th percentile: 12557.000000 msec
  Short term average: 12475.213654 msec
  Long term average: 12336.498446 msec

build_lflows_for_unreachable_vips:
----------------------------------
Statistics for 'ovnnb_db_run'
  Total samples: 37
  Maximum: 9505 msec
  Minimum: 9212 msec
  95th percentile: 9493.000000 msec
  Short term average: 9375.959755 msec
  Long term average: 9311.952156 msec

ovn-nbctl lr-list | wc -l
121
ovn-nbctl ls-list | wc -l
241
ovn-nbctl lb-list | wc -l
47077
ovn-sbctl dump-flows |wc -l
9852935

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
Acked-by: Mark D. Gray <mark.d.gray at redhat.com>
Signed-off-by: Mark Michelson <mmichels at redhat.com>


Compare: https://github.com/ovn-org/ovn/compare/b1a07090740a...b3af6c8c442d


More information about the git mailing list