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

auth: Hash the entire query in the packet cache, split caches #5132

Merged
merged 1 commit into from Apr 3, 2017

Conversation

Projects
None yet
2 participants
@rgacogne
Member

rgacogne commented Mar 10, 2017

Short description

  • The packet cache now behaves a lot like the ones in dnsdist and the recursor, hashing the entire query (except the query id) to prevent matching queries with, for example, different EDNS version.
  • Since the packet and query caches have now much less in common, split them into two different classes since it doesn't make sense to share the same storage and maximum number of entries and doing so clarifies the code a lot. This should also reduce contention.
  • Add a new max-packet-cache-entries setting to control the number of entries in the packet cache.
  • Add a new metric, query-cache-size, the number of entries in the query cache since packetcache-size is only about the packet cache.

Note that contrary to the recursor one's, the new packet cache doesn't skip the content of an EDNS Client Subnet option if present, in case it's used by a backend to produce the response. We could easily change that, or even make it configurable if we care.

Closes #4204.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
auth: Hash the entire query in the packet cache, split caches
* The packet cache now behaves a lot like the ones in dnsdist and
the recursor, hashing the entire query (except the query id)
to prevent matching queries with, for example, different EDNS version.
* Since the packet and query caches have now much less in common, split
them into two different classes since it doesn't make sense to share
the same storage and maximum number of entries and doing so clarifies
the code a lot. This should also reduce contention.
* Add a new `max-packet-cache-entries` setting to control the number of
entries in the packet cache.
* Add a new metric, `query-cache-size`, the number of entries
in the query cache since `packetcache-size` is only about the packet
cache.

Note that contrary to the recursor one's, the new packet cache doesn't
skip the content of an EDNS Client Subnet option if present, in case it's
used by a backend to produce the response. We could easily change that, or
even make it configurable if we care.

@Habbie Habbie merged commit bcef8a9 into PowerDNS:master Apr 3, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Habbie Habbie removed the needs review label Apr 3, 2017

@rgacogne rgacogne deleted the rgacogne:auth-packet-cache branch Apr 3, 2017

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