aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_upstream_zone_module.c
Commit message (Collapse)AuthorAge
* Upstream: copy upstream zone DNS valid time during config reload.Mini Hawthorne2024-11-07
| | | | | | | | | | 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.
* Upstream: pre-resolve servers on reload.Ruslan Ermilov2024-11-07
| | | | | | | | After configuration is reloaded, it may take some time for the re-resolvable upstream servers to resolve and become available as peers. During this time, client requests might get dropped. Such servers are now pre-resolved using the "cache" of already resolved peers from the old shared memory zone.
* Upstream: construct upstream peers from DNS SRV records.Dmitry Volyntsev2024-11-07
|
* Upstream: re-resolvable servers.Ruslan Ermilov2024-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Do not use the obsolete NGX_SOCKADDRLEN macro.Ruslan Ermilov2017-09-22
| | | | | The change in ac120e797d28 re-used the macro which was made obsolete in adf25b8d0431.
* Upstream: copy peer data in shared memory.Ruslan Ermilov2017-08-04
| | | | This, in addition to 1eb753aa8e5e, fixes "upstream zone" on Windows.
* Upstream zone: store peers->name and its data in shared memory.Ruslan Ermilov2017-08-01
| | | | | | | | | | | | The shared objects should generally be allocated from shared memory. While peers->name and the data it points to allocated from cf->pool happened to work on UNIX, it broke on Windows. On UNIX this worked only because the shared memory zone for upstreams is re-created for every new configuration. But on Windows, a worker process does not inherit the address space of the master process, so the peers->name pointed to data allocated from cf->pool by the master process, and was invalid.
* Stream: style.Vladimir Homutov2016-07-12
|
* Stream: added preconfiguration step.Vladimir Homutov2016-06-15
|
* Fixed strict aliasing warnings with old GCC versions.Ruslan Ermilov2015-07-16
|
* Upstream: fixed shared upstreams on win32.Ruslan Ermilov2015-06-16
|
* Stream: added postconfiguration method to stream modules.Vladimir Homutov2015-06-09
|
* Upstream: allow multiple upstreams to use the same shared zone.Ruslan Ermilov2015-04-22
|
* Stream: port from NGINX+.Ruslan Ermilov2015-04-20