Performance issue when delete tokens for users
Bug #1178063 reported by
David Geng
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
David Geng | ||
Grizzly |
Fix Released
|
Medium
|
David Geng |
Bug Description
There is performance issue when we delete a user in our long run test environment:
- 5 tenants
- 300 users associated with tenants as follow:
- Tenant 1 : 100 users
- Tenant 2 : 80 users
- Tenant 3 : 60 users
- Tenant 4 : 40 users
- Tenant 5 : 20 users
And there are more than 144 thousand tokens, with more than 19000 non expired after about 2 days.
tags: | added: grizzly-backport-potential |
Changed in keystone: | |
importance: | Undecided → Medium |
tags: | removed: grizzly-backport-potential |
Changed in keystone: | |
milestone: | none → havana-2 |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | havana-2 → 2013.2 |
To post a comment you must log in.
I think the root cause is in the keystone/ keystone/ identity/ controllers. py, we delete the token for user one by one in the for loop instead of do it in one session.
def _delete_ tokens_ for_user( self, context, user_id, project_id=None): api.list_ tokens( context,
user_ id,
tenant_ id=project_ id):
self. token_api. delete_ token(context, token_id)
pass
#First delete tokens that could get other tokens.
for token_id in self.token_
try:
except exception.NotFound:
The better solution is we provide a new api like token_api. delete_ token_by_ user(context, user_id) to batch delete tokens.