DescribeSecurityGroups very slow in EC2 API

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

Bug Description

DescribeSecurityGroups is very slow in EC2 API if user makes strong use of grantee group rules.
This is the case especially for admin to describe all tenants' groups.

Versions:
master, stable/folsom, stable/essex, stable/diablo

To reproduce:
1. set quota security_groups to 100
2. run the following script:

#!/bin/bash
for i in $(seq 1 99)
do
    euca-add-group group-$i -d group-$i
    for j in $(seq 1 20)
    do
        euca-authorize group-$i -P tcp -p $j -o default
    done
done

3. time euca-describe-groups
real 0m42.857s
user 0m0.240s
sys 0m0.030s

Revision history for this message
Michael Still (mikal) wrote :

What openstack version are you running?

Changed in nova:
status: New → Incomplete
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/15187

Changed in nova:
assignee: nobody → MotoKen (motokentsai)
status: Incomplete → In Progress
MotoKen (motokentsai)
description: updated
Mark McLoughlin (markmc)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/15187
Committed: http://github.com/openstack/nova/commit/358ccf5f196b6b43f18778afae279633c051c6d9
Submitter: Jenkins
Branch: master

commit 358ccf5f196b6b43f18778afae279633c051c6d9
Author: MotoKen <email address hidden>
Date: Thu Nov 1 15:07:52 2012 +0800

    Improve EC2 describe_security_groups performance

    The current implementation of EC2 describe_security_groups makes one
    query per grantee group rule in _format_security_group. This will
    dramatically slow down response time if users make strong use of
    grantee group rules.

    This patch uses just one DB query to get security groups with joined
    grantee_group rules to improve the performance.

    Fixes bug 1073024.

    Change-Id: I34f3253bfef0eabfea39819de03a274dd6f6aaa8

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
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.