Skip to content

designate: speed up API requests by using filters #2498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

sebageek
Copy link
Contributor

When searching for an object in OpenStack we can let the API do the heavy lifting by applying filters (i.e. ListOpts). This helps speeding up the API requests for projects that have a large number of zones or zones that have a large number of records.


In a larger test project this speeds up the API calls from about 30s to 1.5s for filtered vs unfiltered API calls.

When searching for an object in OpenStack we can let the API do the
heavy lifting by applying filters (i.e. ListOpts). This helps speeding
up the API requests for projects that have a large number of zones or
zones that have a large number of records.
@ldez ldez self-requested a review March 26, 2025 13:31
@ldez
Copy link
Member

ldez commented Mar 26, 2025

Hello,

I wonder if this change will create side effects because the wanted value is the full FQDN (_acme-challenge.foo.example.com.), and so this element is not a zone name.

@sebageek
Copy link
Contributor Author

Heyjo,

I don't think this creates site effects, as we're always filtering for the name of what we're looking for.

case 1: getZoneID() gets called with the zone name as wanted. Here we list all zones and then look for a zone that has the zone name we're searching for.

case 2: getRecord() gets called with the FQDN as wanted. Here we list all recordsets belonging to a given zone and filter for one with the wanted name + a type of TXT.

So, as we're always getting wanted as the name of the type of object we're looking for in the API we should be fine there.

Did I understand the question correctly? :)

@ldez ldez added this to the unreleased milestone Mar 26, 2025
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez enabled auto-merge (squash) March 26, 2025 16:52
@ldez ldez merged commit 627e6e2 into go-acme:master Mar 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants