本文内容来自consul官方文档,为了避免以后找不到,故备份一下。
https://learn.hashicorp.com/consul/security-networking/dns-caching
https://www.consul.io/docs/agent/options.html#dns_use_cache
主要内容:
Stale Reads
Stale reads can be used to reduce latency and increase the throughput of DNS queries. The settings used to control stale reads of DNS queries are:
dns_config.allow_stale must be set to true to enable stale reads.
dns_config.max_stale limits how stale results are allowed to be when querying DNS.
With these two settings you can allow or prevent stale reads. Below we will discuss the advantages and disadvantages of both.
"dns_config" {
"allow_stale" = true
"max_stale" = "87600h"
}