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

Projects
None yet
1 participant
@rgacogne
Member

rgacogne commented Jun 11, 2018

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)

@rgacogne rgacogne added this to the dnsdist-1.3.x milestone Jun 11, 2018

rgacogne added some commits Jun 11, 2018

dnsdist: Move rules definitions to a separate header
It makes it easier to test them.
dnsdist: Use LRU to clean the MaxQPSIPRule's store
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 rgacogne:dnsdist-clean-maxqpsiprule-lru branch from 935f58f to 05f4003 Jun 22, 2018

@rgacogne rgacogne requested a review from chbruyand Jun 28, 2018

@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

4 checks passed

LGTM analysis: C/C++ No alert changes
Details
LGTM analysis: JavaScript No alert changes
Details
LGTM analysis: Python No alert changes
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgacogne rgacogne deleted the rgacogne:dnsdist-clean-maxqpsiprule-lru branch Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment