From: Vsevolod Stakhov Date: Tue, 3 Feb 2026 11:52:18 +0000 (+0000) Subject: [Feature] proxy: enable token bucket load balancing by default X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=728f19f20aacb453cf1e4c5c4f14e8a8a523d19c;p=thirdparty%2Frspamd.git [Feature] proxy: enable token bucket load balancing by default Add token_bucket configuration to the default upstream in worker-proxy.inc with sensible defaults (max_tokens=10000, scale=1024, base_cost=10). --- diff --git a/conf/worker-proxy.inc b/conf/worker-proxy.inc index 7f6723854b..f19b396fb1 100644 --- a/conf/worker-proxy.inc +++ b/conf/worker-proxy.inc @@ -25,6 +25,15 @@ timeout = 60s; upstream "local" { default = yes; hosts = "localhost"; + + # Token bucket load balancing: distributes load based on message size + # and current backend utilization (useful with multiple backends) + token_bucket { + max_tokens = 10000; # Maximum token capacity per backend + scale = 1024; # Bytes per token (1KB = 1 token) + min_tokens = 1; # Minimum tokens required for selection + base_cost = 10; # Base cost per request regardless of size + } } count = 1; # Do not spawn too many processes of this type