c-ares: make qcache_max_ttl configurable#45073
Conversation
Signed-off-by: Andy Fong <andy.fong@solo.io>
|
CC @envoyproxy/runtime-guard-changes: FYI only for changes made to |
|
There are some past issues in the past that are closed as not planned related to this problem I am trying to solve:
While the correct solution is probably to deduplicate the DNS lookups across clusters or add native DNS cache. They are probably too big of an effort. I know DNS cache is available in DFP but does not look like it can be easily applied to the DNS lookup used by DNS clusters. There is also the new Hickory DNS resolver that seems to support caching but it's still new and I have not tried that. This is kind of a middle of the ground approach to reduce the DNS lookup from envoy in a large env. It's not ideal that I put the resolver_map_ under the DNSResolver class but only really c-ares impl uses that but that's the simplest route without a lot of changes. Open to any suggestion. |
…tl-main Signed-off-by: Andy Fong <andy.fong@solo.io>
|
cc @yanavlasov |
|
/lgtm api |
|
/assign @yanavlasov |
Commit Message: c-ares: make qcache_max_ttl configurable
Additional Description:
expose the qcache_max_ttl setting and share DNSResolver if cares config is the same so the qcache can be shared. runtime guard "envoy.restart_features.shared_cares_dns_resolver" is set to true by default to enable sharing DNSResolver if cares config of the clusters are the same. Set to false to disable this behavior.
AI is used to generate the tests and write some of the comment but I did review and tune/modify all the tests added. All other code are hand written.
Risk Level: Low
Testing: unit test and manual test using tcpdump to verify multiple clusters with the same host (different port) only generate 1 dns lookup most of the time.
Docs Changes: None
Release Notes: Added qcache_max_ttl field to CaresDnsResolverConfig
Platform Specific Features: None
[Optional Runtime guard:] "envoy.restart_features.shared_cares_dns_resolver" is set to true by default to enable sharing DNSResolver if cares config of the clusters are the same. Set to false to disable this behavior.