]> git.feebdaed.xyz Git - 0xmirror/nginx.git/commit
Upstream: re-resolvable servers.
authorRuslan Ermilov <ru@nginx.com>
Sat, 15 Feb 2014 11:12:34 +0000 (15:12 +0400)
committerAleksei Bavshin <a.bavshin@f5.com>
Thu, 7 Nov 2024 15:57:42 +0000 (07:57 -0800)
commitdb6870e06dde7ab249e9a41a0e0a76219f82dd8c
treed24f1bb15d855a4a85f1240cc4bbbc9dbf6f74be
parentebd18ec1812bd6f3de54d9f9fc81563a0ec9f264
Upstream: re-resolvable servers.

Specifying the upstream server by a hostname together with the
"resolve" parameter will make the hostname to be periodically
resolved, and upstream servers added/removed as necessary.

This requires a "resolver" at the "http" configuration block.

The "resolver_timeout" parameter also affects when the failed
DNS requests will be attempted again.  Responses with NXDOMAIN
will be attempted again in 10 seconds.

Upstream has a configuration generation number that is incremented each
time servers are added/removed to the primary/backup list.  This number
is remembered by the peer.init method, and if peer.get detects a change
in configuration, it returns NGX_BUSY.

Each server has a reference counter.  It is incremented by peer.get and
decremented by peer.free.  When a server is removed, it is removed from
the list of servers and is marked as "zombie".  The memory allocated by
a zombie peer is freed only when its reference count becomes zero.

Co-authored-by: Roman Arutyunyan <arut@nginx.com>
Co-authored-by: Sergey Kandaurov <pluknet@nginx.com>
Co-authored-by: Vladimir Homutov <vl@nginx.com>
18 files changed:
src/http/modules/ngx_http_upstream_hash_module.c
src/http/modules/ngx_http_upstream_ip_hash_module.c
src/http/modules/ngx_http_upstream_least_conn_module.c
src/http/modules/ngx_http_upstream_random_module.c
src/http/modules/ngx_http_upstream_zone_module.c
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream.h
src/http/ngx_http_upstream_round_robin.c
src/http/ngx_http_upstream_round_robin.h
src/stream/ngx_stream_proxy_module.c
src/stream/ngx_stream_upstream.c
src/stream/ngx_stream_upstream.h
src/stream/ngx_stream_upstream_hash_module.c
src/stream/ngx_stream_upstream_least_conn_module.c
src/stream/ngx_stream_upstream_random_module.c
src/stream/ngx_stream_upstream_round_robin.c
src/stream/ngx_stream_upstream_round_robin.h
src/stream/ngx_stream_upstream_zone_module.c