From 0a1aeed17fce16f36c6edf960022d5a6bb80119d Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Sun, 9 Jun 2024 15:15:06 +0200 Subject: [PATCH] Add information about upstreams configuration in options.inc (#758) * Update options.md * Update upstream.md * Fix grammar --------- Co-authored-by: moisseev --- doc/configuration/options.md | 14 ++++++++++++-- doc/configuration/upstream.md | 6 ++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/configuration/options.md b/doc/configuration/options.md index ee567abb9..67a79a1fc 100644 --- a/doc/configuration/options.md +++ b/doc/configuration/options.md @@ -23,6 +23,9 @@ dns { sockets = 16; retransmits = 5; } +upstream { + resolve_min_interval = 60; +} tempdir = "/tmp"; url_tld = "${PLUGINSDIR}/effective_tld_names.dat"; classify_headers = [ @@ -199,6 +202,13 @@ neighbours { } ~~~ -## Upstream options +## Upstreams options + +Upstreams logic and settings are described in the dedicated [document]({{ site.baseurl }}/doc/configuration/upstream.html). +Options for upstreams fall under a dedicated subsection called `upstream` and control their behaviors in Rspamd. Here is a list of available tunables: -See [this document]({{ site.baseurl }}/doc/configuration/upstream.html) for details. +* `error_time` (defaults to `10`): timeframe to check errors in seconds +* `max_errors` (defaults to `4`): maximum count of errors during `error_time` to consider the upstream as down +* `revive_time` (defaults to `60`): count of seconds before attempting to recover upstream after it has faced `max_errors` and has been marked as unhealthy +* `lazy_resolve_time` (defaults to `3600`, which is 1 hour): time in seconds to resolve upstream addresses in lazy mode +* `resolve_min_interval` (defaults to `60`): minimum interval in seconds to perform resolving upstream DNS resolution diff --git a/doc/configuration/upstream.md b/doc/configuration/upstream.md index 91341f05d..608f264c1 100644 --- a/doc/configuration/upstream.md +++ b/doc/configuration/upstream.md @@ -78,8 +78,10 @@ When an upstream reaches the error rate limit, Rspamd marks it as inactive and w +To tune these settings, please see the [Upstream options]({{ site.baseurl }}/doc/configuration/options.html#upstreams-options) documentation. + ## Name resolution -Rspamd treats upstreams defined with their names differently. During the `revive_time`, Rspamd attempts to re-resolve these names and inserts any new IP addresses into the upstream list. If a name has multiple addresses, Rspamd includes all of them. The addresses are then selected using round-robin rotation with error checking. Unlike upstream configurations, errors are persistent and not cleared after successful attempts. Therefore, Rspamd always selects an address with a lower error count. This approach is taken to disable an IPv6 address, for example, if IPv6 is improperly configured in the system. +Rspamd treats upstreams defined with their names differently. During the `revive_time`, Rspamd attempts to re-resolve these names and inserts any new IP addresses into the upstream list. The minimum interval between resolve attempts is controlled by `resolve_min_interval`, which is by default set to 1 minute. If a name has multiple addresses, Rspamd includes all of them. The addresses are then selected using round-robin rotation with error checking. Unlike upstream configurations, errors are persistent and not cleared after successful attempts. Therefore, Rspamd always selects an address with a lower error count. This approach is taken to disable an IPv6 address, for example, if IPv6 is improperly configured in the system. -Starting from version 2.0, Rspamd also performs background resolution of all upstreams every `lazy_resolve_time` + `jitter(0.1 * lazy_resolve_time)`. By default, this value is set to 1 hour, but you can customize it in the configuration (options -> upstreams section). This allows Rspamd to update its knowledge of upstream IP addresses, ensuring efficient and reliable connections. SRV based upstreams are resolved in two steps: one for SRV record resolution and one for targets resolution. +Starting from version 2.0, Rspamd also performs background resolution of all upstreams every `lazy_resolve_time` + `jitter(0.1 * lazy_resolve_time)`. By default, this value is set to 1 hour, but you can customize it in the configuration (options -> upstreams section). This allows Rspamd to update its knowledge of upstream IP addresses, ensuring efficient and reliable connections. SRV-based upstreams are resolved in two steps: one for SRV record resolution and one for target resolution.