Based on the observation that a call to sync_routers can be very
slow (minutes) on some setup, and that profiling data show that
a significant amount of time is spent in many individual calls
of _process_sync_ha_data to _populate_mtu_and_subnets_for_ports for
a single interface, this change refactors _process_sync_ha_data to
call _populate_mtu_and_subnets_for_ports only once on a list of
interfaces instead of <n> times.
Said otherwise:
- before: O(#routers) SQL queries
(one per network of an HA interface of a router)
- after : O(1) SQL queries
(on the set of networks with an HA interface on a router)
A basic test shows a drastic improvements, from minutes to around
one second, in the processing of a sync_routers call with 256 routers.
Reviewed: https:/ /review. openstack. org/470295 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=a858ca7d8fd d625524859b723b 9ce3fdb747b6b6
Committed: https:/
Submitter: Jenkins
Branch: master
commit a858ca7d8fdd625 524859b723b9ce3 fdb747b6b6
Author: Thomas Morin <email address hidden>
Date: Fri Jun 2 15:36:43 2017 +0200
l3_ha_mode: call bulk _populate_ mtu_and_ subnets_ for_ports
Based on the observation that a call to sync_routers can be very sync_ha_ data to _populate_ mtu_and_ subnets_ for_ports for sync_ha_ data to mtu_and_ subnets_ for_ports only once on a list of
slow (minutes) on some setup, and that profiling data show that
a significant amount of time is spent in many individual calls
of _process_
a single interface, this change refactors _process_
call _populate_
interfaces instead of <n> times.
Said otherwise:
- before: O(#routers) SQL queries
(one per network of an HA interface of a router)
- after : O(1) SQL queries
(on the set of networks with an HA interface on a router)
A basic test shows a drastic improvements, from minutes to around
one second, in the processing of a sync_routers call with 256 routers.
Change-Id: I3a00c8fbb245ab 3b6d93bdaa97f34 35570992791
Related-Bug: 1692971