[ovs-git] [ovn-org/ovn] d216e4: ovn-northd: Fix extremely inefficient usage of lfl...

Ilya Maximets noreply at github.com
Tue Aug 24 18:53:52 UTC 2021


  Branch: refs/heads/branch-21.06
  Home:   https://github.com/ovn-org/ovn
  Commit: d216e44a2ce5b6210e3a4868deba33d1a8d608a4
      https://github.com/ovn-org/ovn/commit/d216e44a2ce5b6210e3a4868deba33d1a8d608a4
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-08-24 (Tue, 24 Aug 2021)

  Changed paths:
    M northd/ovn-northd.c

  Log Message:
  -----------
  ovn-northd: Fix extremely inefficient usage of lflow hash map.

'lflow_map' is never expanded because northd always uses fast
insertion.  This leads to the case where we have a hash map
with only 128 initial buckets and every ovn_lflow_find() ends
up iterating over n_lflows / 128 entries.  It's thousands of
logical flows or even more.  For example, it takes forever for
ovn-northd to start up with the Northbound Db from the 120 node
density-heavy test from ovn-heater, because every lookup is slower
than previous one.  I aborted the process after 15 minutes of
waiting, because there was no sign that it will converge.  With
this change applied the loop completes in only 11 seconds.

Hash map will be pre-allocated to the maximum seen number of
logical flows on a second iteration, but this doesn't help for
the first iteration when northd first time connects to a big
Northbound database, which is a common case during failover or
cluster upgrade.  And there is an even trickier case where big
NbDB transaction that explodes the number of logical flows received
on not the first run.

We can't expand the hash map in case of parallel build, so this
should be fixed separately.

CC: Anton Ivanov <anton.ivanov at cambridgegreys.com>
Fixes: 74daa0607c7f ("ovn-northd: Introduce parallel lflow build")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>
(cherry picked from commit e7d6d9922fc4d3c7365990ac8bac26a380e26341)




More information about the git mailing list