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

dnsdist: Use LRU to clean the MaxQPSIPRule's store #6726

Merged
merged 2 commits into from
Jul 9, 2018

Conversation

rgacogne
Copy link
Member

Short description

This makes it possible to remove expired entries from the store without having to scan more than a fraction of it. Entries are ordered by their last usage, with least recently used ones at the front, so we can stop scanning as soon as we find an entry still valid. Even so, we will only consider a fraction of the
store during each pass to keep the cleaning fast, even with a large store.

This PR also moves the rules definitions to a separate header to make it easier to write unit tests for them (in a separate commit, don't waste too much time reading that one).

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

This makes it possible to remove expired entries from the store
without having to scan more than a fraction of it. Entries are
ordered by their last usage, with least recently used ones at
the front, so we can stop scanning as soon as we find an entry
still valid. Even so, we will only consider a fraction of the
store during each pass to keep the cleaning fast, even with a
large store.
@rgacogne rgacogne force-pushed the dnsdist-clean-maxqpsiprule-lru branch from 935f58f to 05f4003 Compare June 22, 2018 08:11
@rgacogne rgacogne requested a review from chbruyand June 28, 2018 13:12
@rgacogne rgacogne modified the milestones: dnsdist-1.3.x, dnsdist-1.3.1 Jul 4, 2018
@rgacogne rgacogne merged commit 379705b into PowerDNS:master Jul 9, 2018
@rgacogne rgacogne deleted the dnsdist-clean-maxqpsiprule-lru branch July 9, 2018 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant