15be883a18
Following the footsteps of [1], depending on the environment where CloudKitty is applied, when using Gnocchi fetcher, if the environment is considerably big, CloudKitty tends to take too much time loading the scope IDs from the Gnocchi API. To reduce that process time, we adopted a different approach to discover the scope IDs registered in Gnocchi. This patch proposes a change in that process, building on top of [1] to load the chunk of Gnocchi resources and execute the retrieval of the scope ID and selecting only the unique ones right away. Then, in the worst case scenario, we would only have 1000 resources being loaded to memory. Furthermore, we use the ``search`` API method from Gnocchi to filter resources that are from scopes that are not in the set already loaded. Therefore, we do not need to go over all of the resources in Gnocchi. We will only list all of the resources that do not have the scope IDs already loaded. This reduced the processing time to load scope IDs from about 5 minutes to 40 seconds in an environment with 500 scopes and ~50,000 resources. [1] https://review.opendev.org/c/openstack/cloudkitty/+/864269 Change-Id: I9fa8934c5c857bd0069bb8038423e0126739a310
7 lines
187 B
YAML
7 lines
187 B
YAML
---
|
|
issues:
|
|
- |
|
|
Optimize Gnocchi fetcher runtime to avoid taking too long to load scopes
|
|
when CloudKitty runs in cloud environments with hundreds of thousands of
|
|
resources.
|