forked from ovn-org/ovn
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
controller: ofctrl: Use index for meter lookups.
Currently, ovn-controller attempts to sync all the meters on each ofctrl_put() call. And the complexity of this logic is quadratic because for each desired meter we perform a full scan of all the rows in the Southbound Meter table in order to lookup a matching meter. This is very inefficient. In a setup with 25K meters this operation takes anywhere from 30 to 60 seconds to perform. All that time ovn-controller is blocked and doesn't process any updates. So, addition of new ports in such a setup becomes very slow. The meter lookup is performed by name and we have an index for it in the database schema. Might as well use it. Using the index for lookup reduces complexity to O(n * log n). And the time to process port addition on the same setup drops down to just 100 - 300 ms. We are still iterating over all the desired meters while they can probably be processed incrementally instead. But using an index is a simpler fix for now. Fixes: 885655e ("controller: reconfigure ovs meters for ovn meters") Fixes: 999e1ad ("ovn: Support configuring meters through SB Meter table.") Reported-at: https://issues.redhat.com/browse/FDP-399 Signed-off-by: Ilya Maximets <[email protected]> Acked-by: Han Zhou <[email protected]> Signed-off-by: Mark Michelson <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters