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

implement dynamic cache sizeing for recursor #5699

Merged
merged 3 commits into from Sep 28, 2017

Conversation

Projects
None yet
3 participants
@ahupowerdns
Member

ahupowerdns commented Sep 15, 2017

Short description

With this commit, the number of (packet)cache entries can be changed at runtime, although the effect may not be immediate in case of shrinking the cache.

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)
  • checked that this code was merged to master

ahupowerdns added some commits Sep 15, 2017

implement dynamic cache sizeing for recursor
With this commit, the number of (packet)cache entries can be changed at runtime, although the effect may not be immediate in case of shrinking the cache.
so I had to fill out "did you compile and test this code" and I nearl…
…y lied. So I tried it and it sucked. Better now.
SyncRes::pruneNegCache(::arg().asNum("max-cache-entries") / (g_numWorkerThreads * 10));
SyncRes::pruneNegCache(g_maxCacheEntries / (g_numWorkerThreads * 10));

This comment has been minimized.

@rgacogne

rgacogne Sep 15, 2017

Member

Not related to this PR but I wonder where does the 10 comes from in g_numWorkerThreads * 10. And why we divide by g_numWorkerThreads (the number of worker threads) for the packet and neg caches, but by g_numThreads (number of worker threads + 1 if pdns-distribute-queries is set) for the query cache.

@rgacogne

rgacogne Sep 15, 2017

Member

Not related to this PR but I wonder where does the 10 comes from in g_numWorkerThreads * 10. And why we divide by g_numWorkerThreads (the number of worker threads) for the packet and neg caches, but by g_numThreads (number of worker threads + 1 if pdns-distribute-queries is set) for the query cache.

@pieterlexis

Cool! Maybe we should export this value as a metric?

@ahupowerdns

This comment has been minimized.

Show comment
Hide comment
@ahupowerdns

ahupowerdns Sep 18, 2017

Member

added metrics.

Member

ahupowerdns commented Sep 18, 2017

added metrics.

@ahupowerdns ahupowerdns merged commit b040ba3 into PowerDNS:master Sep 28, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment