diff options
author | Mini Hawthorne <mini@f5.com> | 2023-07-12 12:20:45 -0700 |
---|---|---|
committer | Aleksei Bavshin <a.bavshin@f5.com> | 2024-11-07 07:57:42 -0800 |
commit | 29aec5720fdfc74dca8d99d5cf6dc0fcb4e4ce2f (patch) | |
tree | a04b9975051ba44f5dc7b1532b4d66f97de900a5 /src/http/ngx_http_upstream_round_robin.h | |
parent | ea4654550ab021b5576c03b708079e3ce3e5d9ed (diff) | |
download | nginx-29aec5720fdfc74dca8d99d5cf6dc0fcb4e4ce2f.tar.gz nginx-29aec5720fdfc74dca8d99d5cf6dc0fcb4e4ce2f.zip |
Upstream: copy upstream zone DNS valid time during config reload.
Previously, all upstream DNS entries would be immediately re-resolved
on config reload. With a large number of upstreams, this creates
a spike of DNS resolution requests. These spikes can overwhelm the
DNS server or cause drops on the network.
This patch retains the TTL of previous resolutions across reloads
by copying each upstream's name's expiry time across configuration
cycles. As a result, no additional resolutions are needed.
Diffstat (limited to 'src/http/ngx_http_upstream_round_robin.h')
-rw-r--r-- | src/http/ngx_http_upstream_round_robin.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h index 084b0b886..2f0a51cdf 100644 --- a/src/http/ngx_http_upstream_round_robin.h +++ b/src/http/ngx_http_upstream_round_robin.h @@ -25,6 +25,7 @@ typedef struct { ngx_uint_t worker; ngx_str_t name; ngx_str_t service; + time_t valid; ngx_http_upstream_rr_peers_t *peers; ngx_http_upstream_rr_peer_t *peer; } ngx_http_upstream_host_t; |