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

dns masq should have resources defined #29055

Closed
bprashanth opened this issue Jul 16, 2016 · 6 comments
Closed

dns masq should have resources defined #29055

bprashanth opened this issue Jul 16, 2016 · 6 comments
Assignees
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@bprashanth
Copy link
Contributor

kubedns has resource/limits but not the dnsmasq cache.

@bprashanth bprashanth added sig/network Categorizes an issue or PR as relevant to SIG Network. team/cluster labels Jul 16, 2016
@bprashanth bprashanth added this to the next-candidate milestone Jul 16, 2016
@girishkalele girishkalele added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Aug 30, 2016
@girishkalele
Copy link

100m is probably enough for CPU.
For memory resources, need to fill up dnsmasq cache with its default cache-limit using the dnsbench sample queries file and measure memory utilization.

@girishkalele
Copy link

This Google 20% project looks like another DNS benchmark datapoint we could use.

https://code.google.com/archive/p/namebench/

@bowei
Copy link
Member

bowei commented Oct 15, 2016

Dnsmasq memory consumption

To reproduce these results:

https://github.com/bowei/contrib/tree/dnsmasq-mem/dnsmasq-mem

TLDR

dnsmasq in its current configuration caps the size of its cache to 10k records. (See src/options.c) It will not use more than 3mb for typical workloads. When the cache limit was removed, we get the following memory usage scaling:

cache size memory footprint
10k ~3 mb
100k 13 mb
1M 112 mb

Dnsmasq notes

  • Source code has a hard limit of 10k cache entries. Performance seem to degrade when limit is increased to 1M most likely due to internal data structure choices.
  • Does not cache entry types that are unbounded in memory usage (e.g.
    TXT records).
  • Each record in a response consumes a single entry in the cache. E.g. if
    foo.com has 5 A records returned, then this will consume 5 entries.
  • If a response with multiple records does not fit in the cache, it is not
    cached.

Evaluation details

Evaluation consists of a bind9 server configured to return synthetic records
(A, AAAA, TXT, SRV) of varying cardinality (# of result records), a dnsmasq instance and dnsperf client:

  +------+       +---------+       +---------+
  | bind | <---- | dnsmasq | <---- | dnsperf |
  +------+       +---------+       +---------+

make will build the docker images and run the memory consumption harness. The resulting run.log will contain the resulting memory used by dnsmasq after fully populating its cache.

@bprashanth
Copy link
Contributor Author

Makes sense, so we need to define resource request on https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/skydns-rc.yaml.in#L85. are you suggesting 100m cpu and the default 10k/10mb memory? if cpu is left unspecified I believe it gets the lowest possible allocation under load (2 shares).

@bprashanth
Copy link
Contributor Author

@bowei Hmm, you are a member of the Kubernetes org but I can't assign the bug to you. I think you got unassigned on my last comment, perhaps because you jumped in/out of membership somehow?

@bowei
Copy link
Member

bowei commented May 11, 2017

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

No branches or pull requests

5 participants