Skip to content
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

Increase AWS pagination size #2009

Merged

Conversation

tjamet
Copy link
Contributor

@tjamet tjamet commented Mar 12, 2021

From measurements, AWS by default has pagination of 100 items per
page when listing hosted zone resources.

This increases the number of requests required to list all our zones,
and pushes a hard constraint on the rate limits.

From the experiments, it seems that on the server-side, there is a hard
limit of 300 elements per page, as per AWS documentation:
https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRecordSets.html

ListResourceRecordSets returns up to 300 resource record sets at a time in ASCII order,
beginning at a position specified by the name and type elements

Hence raising the page size from 100 to 300 items would decrease by 3
the number of requests posted to Route53

We even set a higher limit so we can benefit from a lower number of
requests if ever AWS increases the hard limit of 300.

contributes to improving #1293

Checklist

  • Unit tests updated
  • End user documentation updated

I didn't find a place where to update the documentation

From measurements, AWS by default has pagination of 100 items per
page when listing hosted zone resources.

This increases the number of requests required to list all our zones,
and pushes a hard constraint on the rate limits.

From the experiments, it seems that on the server-side, there is a hard
limit of 300 elements per page, as per AWS documentation:
https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRecordSets.html

> ListResourceRecordSets returns up to 300 resource record sets at a time in ASCII order,
> beginning at a position specified by the name and type elements

Hence raising the page size from 100 to 300 items would decrease by 3
the number of requests posted to Route53

We even set a higher limit so we can benefit from a lower number of
requests if ever AWS increases the hard limit of 300.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 12, 2021
@tjamet
Copy link
Contributor Author

tjamet commented Mar 12, 2021

/assign @Raffo

Copy link
Contributor

@Raffo Raffo left a comment

Choose a reason for hiding this comment

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

@tjamet I have one comment, if addressed I'm happy to merge this.

// when less items are returned, and still paginate accordingly.
// As we are using the standard AWS client, this should already be compliant.
// Hence, ifever AWS decides to raise this limit, we will automatically reduce the pressure on rate limits
MaxItems: aws.String("1000"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer having this as 300 as it's the limit now.

I would also love to see a constant declared for that instead of a magic number string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done :D

@Raffo
Copy link
Contributor

Raffo commented Mar 25, 2021

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Raffo, tjamet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2021
@k8s-ci-robot k8s-ci-robot merged commit 10d0ee1 into kubernetes-sigs:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants