Performance of list_projects_for_user impacting keystone

Bug #1362557 reported by Henry Nash
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Henry Nash

Bug Description

The assignment call list_projects_for_user() is commonly used - not least every time you issue a scoped token. Ina test configuration, this method was consuming 36% of all keystone clock time. This call searches the assignments table (which has one row for every assignment, so could be very large in enterprise situations) by actor_id. Although actor_id is part of a composite primary key, when used alone it is like any other non-indexed column.

Adding an index for actor ID would significantly improve performance, and since the read frequency of such a table is probably much greater than new role assignments being added, this seems like a good trade-off.

Such an index would also improve the performance of get role_assignments, when used to get role assignments for a user - which would seem a likely common usage pattern

Tags: performance
Henry Nash (henry-nash)
Changed in keystone:
assignee: nobody → Henry Nash (henry-nash)
importance: Undecided → High
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: New → In Progress
Henry Nash (henry-nash)
Changed in keystone:
milestone: none → juno-3
Dolph Mathews (dolph)
tags: added: performance
Changed in keystone:
assignee: Henry Nash (henry-nash) → Rodrigo Duarte (rodrigodsousa)
Changed in keystone:
assignee: Rodrigo Duarte (rodrigodsousa) → Henry Nash (henry-nash)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/117541
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=0cb9c042ac90395ad510ab04cf9442c723a60a33
Submitter: Jenkins
Branch: master

commit 0cb9c042ac90395ad510ab04cf9442c723a60a33
Author: Henry Nash <email address hidden>
Date: Thu Aug 28 12:30:14 2014 +0100

    Add index for actor_id in assignments table.

    Searching the assignments table by actor_id is a common occurance
    and in a large OpenStack installation, this can be a significant
    performance degradation. This table is read much more often than
    it is written, so this should be a good trade off.

    Change-Id: Ia1a4392ca2118690a10130b10b2f69cd05672a12
    Closes-bug: 1362557

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-3 → 2014.2
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.