]> git.kaiwu.me - nginx.git/commit
Upstream: copy upstream zone DNS valid time during config reload.
authorMini Hawthorne <mini@f5.com>
Wed, 12 Jul 2023 19:20:45 +0000 (12:20 -0700)
committerAleksei Bavshin <a.bavshin@f5.com>
Thu, 7 Nov 2024 15:57:42 +0000 (07:57 -0800)
commit29aec5720fdfc74dca8d99d5cf6dc0fcb4e4ce2f
treea04b9975051ba44f5dc7b1532b4d66f97de900a5
parentea4654550ab021b5576c03b708079e3ce3e5d9ed
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.
src/http/modules/ngx_http_upstream_zone_module.c
src/http/ngx_http_upstream_round_robin.h
src/stream/ngx_stream_upstream_round_robin.h
src/stream/ngx_stream_upstream_zone_module.c