yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #02973
[Bug 1174111] Re: List ports operation reloads security group associations for each port
** Changed in: quantum
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to quantum.
https://bugs.launchpad.net/bugs/1174111
Title:
List ports operation reloads security group associations for each port
Status in OpenStack Quantum (virtual network service):
Fix Released
Bug description:
All the plugins implementing the security groups mixin invoke the
extend_port_dict_security_group method for each port in get_ports:
https://github.com/openstack/quantum/blob/master/quantum/plugins/openvswitch/ovs_quantum_plugin.py#L598
The implementation of the above method in the mixin executes another
query in the database:
https://github.com/openstack/quantum/blob/master/quantum/db/securitygroups_db.py#L382
As a result, get_ports results in at least(*) N+1 queries. This is not
great news for working at scale, since this could be easily improved.
These are some results from the current source code (comple API
request/response on local host, against in memory-db)
#### PORTS:100
#### ELAPSED TIME:0.355845928192
#### PORTS:200
#### ELAPSED TIME:0.682465076447
#### PORTS:300
#### ELAPSED TIME:1.22520112991
#### PORTS:400
#### ELAPSED TIME:1.57488203049
#### PORTS:500
#### ELAPSED TIME:1.78997802734
#### PORTS:600
#### ELAPSED TIME:2.14011096954
#### PORTS:700
#### ELAPSED TIME:2.43111586571
#### PORTS:800
#### ELAPSED TIME:3.13826489449
#### PORTS:900
#### ELAPSED TIME:3.53332614899
#### PORTS:1000
#### ELAPSED TIME:3.43961691856
Where as the following results are obtained with a joined load:
#### PORTS:100
#### ELAPSED TIME:0.26810002327
#### PORTS:200
#### ELAPSED TIME:0.464941978455
#### PORTS:300
#### ELAPSED TIME:0.683457136154
#### PORTS:400
#### ELAPSED TIME:1.03992795944
#### PORTS:500
#### ELAPSED TIME:1.34910178185
#### PORTS:600
#### ELAPSED TIME:1.503729105
#### PORTS:700
#### ELAPSED TIME:1.80103898048
#### PORTS:800
#### ELAPSED TIME:1.95511293411
#### PORTS:900
#### ELAPSED TIME:2.32195305824
#### PORTS:1000
#### ELAPSED TIME:2.76952195168
These numbers are probably not very well representative - and more measurements should be provided.
However, they show that there's undoubtedly a gain in performance - and considering a considerably smaller number of queries performed, it will improve also scalability.
(*) at least because if the plugin supports multiple extension which add attributes to the port resource the number of queries might actually increase.
To manage notifications about this bug go to:
https://bugs.launchpad.net/quantum/+bug/1174111/+subscriptions