This patch improves check_token validation performance by only pulling
revocation events based on the token issued_at value, taking advantage
of the table index. In this way, only a subset of relevant events will
be returned for validation.
Benchmarks can be seen at [1], but included here as well:
Time per Request for Old Method
-------------------------------
10 revokes at 7.908
100 revokes at 18.224
1,000 revokes at 110.155
10,000 revokes at 1998.220
Time per Request New Method
---------------------------
10 revokes at 17.636ms,
100 revokes at 17.279ms,
1,000 revokes at 17.370,
10,000 revokes w/all revokes issued before token at 17.263 (best case)
10,000 revokes w/all revokes after token creation 44.934ms (worst case)
Reviewed: https:/ /review. openstack. org/382107 /git.openstack. org/cgit/ openstack/ keystone/ commit/ ?id=9e843714618 31880ce5736e988 8c7d9648e3a77b
Committed: https:/
Submitter: Jenkins
Branch: master
commit 9e8437146183188 0ce5736e9888c7d 9648e3a77b
Author: “Richard <email address hidden>
Date: Tue Oct 4 23:00:31 2016 +0000
Improve check_token validation performance
This patch improves check_token validation performance by only pulling
revocation events based on the token issued_at value, taking advantage
of the table index. In this way, only a subset of relevant events will
be returned for validation.
Benchmarks can be seen at [1], but included here as well:
Time per Request for Old Method ------- ------- ------- -------
---
10 revokes at 7.908
100 revokes at 18.224
1,000 revokes at 110.155
10,000 revokes at 1998.220
Time per Request New Method ------- ------- ------- ---
---
10 revokes at 17.636ms,
100 revokes at 17.279ms,
1,000 revokes at 17.370,
10,000 revokes w/all revokes issued before token at 17.263 (best case)
10,000 revokes w/all revokes after token creation 44.934ms (worst case)
[1] https:/ /gist.github. com/csrichard1/ 4b7b8527ee5a656 5a84956cff33cf2 9b
Change-Id: I9c2f067d870d54 2ec5909eaf8b24d ed07b75f433
Partial-Bug: 1524030