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

Publish metrics of cached entries #94

Closed
zihaoyu opened this issue May 23, 2017 · 5 comments
Closed

Publish metrics of cached entries #94

zihaoyu opened this issue May 23, 2017 · 5 comments

Comments

@zihaoyu
Copy link

zihaoyu commented May 23, 2017

It would be helpful if we can get dnsmasq cached entries number from its metrics endpoint.

If this metric is already published, I apologize and please let me know the name of it.

Thank you.

@bowei
Copy link
Member

bowei commented May 23, 2017

dnsmasq cache is limited to 10k entries total. Would the number of evictions be more useful? What are you trying to determine?

from k8s.io/dns/pkg/dnsmasq/mterics.go:

const ( 
        // CacheHits from dnsmasq.
        CacheHits MetricName = "hits"
        // CacheMisses from dnsmasq
        CacheMisses MetricName = "misses"
        // CacheEvictions from dnsmasq
        CacheEvictions MetricName = "evictions"
        // CacheInsertions from dnsmasq
        CacheInsertions MetricName = "insertions"
        // CacheSize from dnsmasq
        CacheSize MetricName = "cachesize"
)

@zihaoyu
Copy link
Author

zihaoyu commented May 23, 2017

I see. That works too. Thank you.

I was wanting to see how many entries are cached so I can adjust the cache size flag accordingly. Is there any reason I don't want to set cache to max size?

@bowei
Copy link
Member

bowei commented May 23, 2017

10k entries takes 10 Mb. Unless you are extremely resource constrained, I would set it to max.

@zihaoyu
Copy link
Author

zihaoyu commented May 23, 2017

Thanks. Noted.

@zihaoyu zihaoyu closed this as completed May 23, 2017
@zihaoyu
Copy link
Author

zihaoyu commented May 24, 2017

@bowei So I'm seeing zero evictions and constant insertions. Does that mean the entries are being overwritten all the time? From the graph below, it looks like I'm using about 200 to 250 cache entries. Is that correct? Thanks.

cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants