Inefficient use of db calls to get instance rules in virt/firewall.py

Bug #1528041 reported by Hans Lindgren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Hans Lindgren

Bug Description

When getting instance rules in virt/firewall.py a for loop is used to query the db for rules belonging to each individual security group in a list of security groups that itself comes from a separate query. See:

https://github.com/openstack/nova/blob/47e5199f67949f3cbd73114f4f45591cbc01bdd5/nova/virt/firewall.py#L349

This can be made much more efficient by querying all rules in a single db query joined by instance.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/259810

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: performance
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/259810
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=82636d678883788c3781164e3453b58bfa0661cf
Submitter: Jenkins
Branch: master

commit 82636d678883788c3781164e3453b58bfa0661cf
Author: Hans Lindgren <email address hidden>
Date: Fri Dec 11 11:19:07 2015 +0100

    Reduce the number of db/rpc calls to get instance rules

    When getting instance rules in virt/firewall.py a for loop is used to
    issue db queries for rules belonging to each individual security group
    in a list of security groups that itself is fetched using a separate
    query.

    This can be made much more efficient by querying all rules in a single
    db query joined by instance.

    Change-Id: I325f9c71fecde8297842fd608ac3cfd51ea9db71
    Closes-Bug: #1528041

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b2

This issue was fixed in the openstack/nova 13.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.