openstack endpoint list is slow in case of many endpoints
Bug #1719413 reported by Anton Frolov
This bug affects 7 people
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| python-openstackclient |
Fix Released |
Undecided |
Anton Frolov | ||
Bug Description
openstack endpoint list command take 10 seconds to produce output when is executed against keystone with HTTPS endpoint and large number of endpoints and/or regions.
Example:
$ env | grep OS_AUTH_URL
OS_AUTH_URL=https:/ /keystone. openstack. local:5000/ v3
$ openstack endpoint list -f csv | wc -l
55
$ time openstack endpoint list > /dev/null
real 0m13.357s
user 0m2.070s
sys 0m0.238s
Looking at the code, it seems that ListEndpoint. take_action unconditionally loop over all endpoints and issue GET request to /v3/services/ <endpoint. service_ id> API for EACH endpoint, sometimes several times for same service ID (at least 3 times, once for public, once for internal and once for admin).
We need to fix that.