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

Comments

@bprashanth
Copy link
Member

@bprashanth bprashanth commented Jul 16, 2016

kubedns has resource/limits but not the dnsmasq cache.

@girishkalele

This comment has been minimized.

Copy link
Contributor

@girishkalele girishkalele commented Aug 30, 2016

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

This comment has been minimized.

Copy link
Contributor

@girishkalele girishkalele commented Sep 2, 2016

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

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

@bowei

This comment has been minimized.

Copy link
Member

@bowei 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

This comment has been minimized.

Copy link
Member Author

@bprashanth bprashanth commented Oct 17, 2016

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

This comment has been minimized.

Copy link
Member Author

@bprashanth bprashanth commented Oct 17, 2016

@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

This comment has been minimized.

Copy link
Member

@bowei bowei commented May 11, 2017

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.