52662cad7a
Since [1], we introduced a way to skip the load of the OVO synthetic
fields depending on the resource fields retrieved. In the case of the
security groups (SG), the SG rules are child objects to the SGs. The SG
rules are retrieved when a SG OVO is created.
The improvement done in [1] is to make the SG rules load dynamically,
that means using the load mode "lazy='dynamic'". That will issue a SQL
query only if the SG rules are read; if not, the query is never issued.
However since [2] (and this is previous to the [1] optimization), we
always add the field "shared" to the filters and thus to the fields to
retrieve, because it is a policy required field. Because "shared" is a
synthetic field [3], that will force the SG "synthetic_fields" load and
the retrieval of the SG rules always. This is undoing any performance
improvement.
This patch is changing the loading method to "joined"; that will request
the SG rules in the same SQL query, instead of issuing separate queries
for the SG rules. Until a method to load the SG "shared" field,
independently of the synthetic OVO fields is implemented, this change
will improve the SG retrieval performance. In a testing environment
with around 5500K SG and 4 rules (default ones) per SG:
* lazy='dynamic': 38 seconds
* lazy='select': 20 seconds
* lazy='joined': 12 seconds
[1]https://review.opendev.org/q/topic:%22bug/1810563%22
[2]https://review.opendev.org/c/openstack/neutron/+/328313
[3]
|
||
---|---|---|
.. | ||
plugins | ||
README | ||
__init__.py | ||
address_group.py | ||
address_scope.py | ||
agent.py | ||
allowed_address_pair.py | ||
conntrack_helper.py | ||
data_plane_status.py | ||
dns.py | ||
dvr.py | ||
external_net.py | ||
flavor.py | ||
l3.py | ||
l3_attrs.py | ||
l3agent.py | ||
l3ha.py | ||
local_ip.py | ||
loggingapi.py | ||
metering.py | ||
ndp_proxy.py | ||
network_segment_range.py | ||
ovn.py | ||
port_device_profile.py | ||
port_forwarding.py | ||
port_hardware_offload_type.py | ||
port_hints.py | ||
port_numa_affinity_policy.py | ||
provisioning_block.py | ||
securitygroup.py | ||
securitygroup_default_rules.py | ||
segment.py | ||
servicetype.py | ||
subnet_service_type.py | ||
tag.py | ||
uplink_status_propagation.py |
README
This directory is designed to contain all SQLAlchemy models shipped with core Neutron. * The expected directory structure is flat, except for the ML2 plugins. All ML2 plugin models should fall under the plugins subdirectory (i.e. plugins/ml2/gre_allocation). * Module names should use singular forms for nouns (port.py, not ports.py).