dns cache: add ability to prefetch hostnames to resolve during cache construction (#16891)

Commit Message: this PR adds the ability to prefetch hostnames to resolve during cache construction.
Additional Description: This feature can be used as a performance improvement for setups that use dns cache, but know a priori some of the hostnames that will be used.
Risk Level: low -- adds a feature that is off by default.
Testing: new tests
Docs Changes: added documentation in the API
Release Notes: inline

Signed-off-by: Jose Nino <jnino@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 7b492bdff96649aee29017fcaabaf37a39407d8a
pull/624/head
data-plane-api(Azure Pipelines) 4 years ago
parent b653598666
commit a1a18d44aa
  1. 8
      envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto
  2. 8
      envoy/extensions/common/dynamic_forward_proxy/v4alpha/dns_cache.proto

@ -3,6 +3,7 @@ syntax = "proto3";
package envoy.extensions.common.dynamic_forward_proxy.v3;
import "envoy/config/cluster/v3/cluster.proto";
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/resolver.proto";
import "google/protobuf/duration.proto";
@ -29,7 +30,7 @@ message DnsCacheCircuitBreakers {
// Configuration for the dynamic forward proxy DNS cache. See the :ref:`architecture overview
// <arch_overview_http_dynamic_forward_proxy>` for more information.
// [#next-free-field: 10]
// [#next-free-field: 11]
message DnsCacheConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.common.dynamic_forward_proxy.v2alpha.DnsCacheConfig";
@ -108,4 +109,9 @@ message DnsCacheConfig {
// DNS resolution configuration which includes the underlying dns resolver addresses and options.
config.core.v3.DnsResolutionConfig dns_resolution_config = 9;
// Hostnames that should be preresolved into the cache upon creation. This might provide a
// performance improvement, in the form of cache hits, for hostnames that are going to be
// resolved during steady state and are known at config load time.
repeated config.core.v3.SocketAddress preresolve_hostnames = 10;
}

@ -3,6 +3,7 @@ syntax = "proto3";
package envoy.extensions.common.dynamic_forward_proxy.v4alpha;
import "envoy/config/cluster/v4alpha/cluster.proto";
import "envoy/config/core/v4alpha/address.proto";
import "envoy/config/core/v4alpha/resolver.proto";
import "google/protobuf/duration.proto";
@ -31,7 +32,7 @@ message DnsCacheCircuitBreakers {
// Configuration for the dynamic forward proxy DNS cache. See the :ref:`architecture overview
// <arch_overview_http_dynamic_forward_proxy>` for more information.
// [#next-free-field: 10]
// [#next-free-field: 11]
message DnsCacheConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.extensions.common.dynamic_forward_proxy.v3.DnsCacheConfig";
@ -105,4 +106,9 @@ message DnsCacheConfig {
// DNS resolution configuration which includes the underlying dns resolver addresses and options.
config.core.v4alpha.DnsResolutionConfig dns_resolution_config = 9;
// Hostnames that should be preresolved into the cache upon creation. This might provide a
// performance improvement, in the form of cache hits, for hostnames that are going to be
// resolved during steady state and are known at config load time.
repeated config.core.v4alpha.SocketAddress preresolve_hostnames = 10;
}

Loading…
Cancel
Save