_make_firewall_dict_with_rules gets FW rules one by one from db

Bug #1658817 reported by Cedric Brandily on 2017-01-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
High
Cedric Brandily

Bug Description

_make_firewall_dict_with_rules returns a firewall and its rules by calling get_firewall, get_firewall_policy and get_firewall_rule for each rule ... which implies a db query for each rule and slowness (on my deploiement 12s to get a firewall with 1000 rules).

It seems possible to get all FW rules in one db query.

tags: added: mitaka-backport-potential newton-backport-potential

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

Changed in neutron:
status: New → In Progress

Reviewed: https://review.openstack.org/424361
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=8a97921783cc4b7aae2b0c2fd764813fa0aa2821
Submitter: Jenkins
Branch: master

commit 8a97921783cc4b7aae2b0c2fd764813fa0aa2821
Author: Cedric Brandily <email address hidden>
Date: Mon Jan 23 23:37:48 2017 +0100

    Optimize _make_firewall_dict_with_rules db queries

    This change optimizes _make_firewall_dict_with_rules implementation by
    getting rules for a firewall in one db query instead of one db query per
    rule (previous implementation). It improves performance: typically on
    my deployment _make_firewall_dict_with_rules for a firewall with 1000
    rules takes 0.2s instead of 12s with previous implementation.

    Change-Id: Ia5cd39ec4ee388fab21884d08e2b19f6f6c484d5
    Closes-Bug: #1658817

Changed in neutron:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron-fwaas 10.0.0.0b3 development milestone.

Changed in neutron:
milestone: none → ocata-rc1
tags: added: ocata-rc-potential
Changed in neutron:
importance: Undecided → High

Reviewed: https://review.openstack.org/424875
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=0565b488b1c3dd18b927690237ebbe90c510eb4c
Submitter: Jenkins
Branch: master

commit 0565b488b1c3dd18b927690237ebbe90c510eb4c
Author: Cedric Brandily <email address hidden>
Date: Tue Jan 24 23:08:43 2017 +0100

    Optimize _make_firewall_group_dict_with_rules

    This change optimizes _make_firewall_group_dict_with_rules
    implementation by getting rules for a firewall in one db query (through
    the new method _get_policy_ordered_rules) instead of one db query per
    rule (previous implementation) in order to improve performance.

    Related-Bug: #1658817
    Change-Id: Ibf13a9c0a4d504d47bd92fbd958c2d5e24abfdad

Reviewed: https://review.openstack.org/425075
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=651069db85a9e793470a5deb198b08ed2a76eab2
Submitter: Jenkins
Branch: stable/mitaka

commit 651069db85a9e793470a5deb198b08ed2a76eab2
Author: Cedric Brandily <email address hidden>
Date: Mon Jan 23 23:37:48 2017 +0100

    Optimize _make_firewall_dict_with_rules db queries

    This change optimizes _make_firewall_dict_with_rules implementation by
    getting rules for a firewall in one db query instead of one db query per
    rule (previous implementation). It improves performance: typically on
    my deployment _make_firewall_dict_with_rules for a firewall with 1000
    rules takes 0.2s instead of 12s with previous implementation.

    Change-Id: Ia5cd39ec4ee388fab21884d08e2b19f6f6c484d5
    Closes-Bug: #1658817
    (cherry picked from commit 8a97921783cc4b7aae2b0c2fd764813fa0aa2821)

tags: added: in-stable-mitaka

Reviewed: https://review.openstack.org/425061
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=b3abd7dfafbff913eb94e7640a2656774699a9a3
Submitter: Jenkins
Branch: stable/newton

commit b3abd7dfafbff913eb94e7640a2656774699a9a3
Author: Cedric Brandily <email address hidden>
Date: Mon Jan 23 23:37:48 2017 +0100

    Optimize _make_firewall_dict_with_rules db queries

    This change optimizes _make_firewall_dict_with_rules implementation by
    getting rules for a firewall in one db query instead of one db query per
    rule (previous implementation). It improves performance: typically on
    my deployment _make_firewall_dict_with_rules for a firewall with 1000
    rules takes 0.2s instead of 12s with previous implementation.

    Change-Id: Ia5cd39ec4ee388fab21884d08e2b19f6f6c484d5
    Closes-Bug: #1658817
    (cherry picked from commit 8a97921783cc4b7aae2b0c2fd764813fa0aa2821)

tags: added: in-stable-newton

Reviewed: https://review.openstack.org/427508
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas/commit/?id=6b5a4ee0db410817e5263b04dc7cb3762eb5bf41
Submitter: Jenkins
Branch: stable/newton

commit 6b5a4ee0db410817e5263b04dc7cb3762eb5bf41
Author: Cedric Brandily <email address hidden>
Date: Tue Jan 24 23:08:43 2017 +0100

    Optimize _make_firewall_group_dict_with_rules

    This change optimizes _make_firewall_group_dict_with_rules
    implementation by getting rules for a firewall in one db query (through
    the new method _get_policy_ordered_rules) instead of one db query per
    rule (previous implementation) in order to improve performance.

    Related-Bug: #1658817
    Change-Id: Ibf13a9c0a4d504d47bd92fbd958c2d5e24abfdad
    (cherry picked from commit 0565b488b1c3dd18b927690237ebbe90c510eb4c)

This issue was fixed in the openstack/neutron-fwaas 9.0.1 release.

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

Other bug subscribers