List ports operation reloads security group associations for each port
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Low
|
Salvatore Orlando |
Bug Description
All the plugins implementing the security groups mixin invoke the extend_
The implementation of the above method in the mixin executes another query in the database: https:/
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.
tags: | added: grizzly-backport-potential |
tags: | removed: grizzly-backport-potential |
Changed in quantum: | |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | havana-1 → 2013.2 |
I am setting importance for this bug report as 'low', meaning that the server is not broken at all because it, but that's something which can make the server work better at scale.
Also, the same kind of bug can be reported pretty much for each 'attribute' extension currently used in quantum.
This work can fall in the framework of db 'improvements' agreed at the summit.