aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/fuzzy_check.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-04-23 15:40:43 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-04-23 15:40:43 +0100
commit26ac157abccadd0e62868f35438fb04ff41d7195 (patch)
tree2711f02f0080a873450ffb988f2c68dcb064457e /src/plugins/fuzzy_check.c
parente66c993097278b8a9df7fc3c213e74d7753db44a (diff)
downloadrspamd-26ac157abccadd0e62868f35438fb04ff41d7195.tar.gz
rspamd-26ac157abccadd0e62868f35438fb04ff41d7195.zip
[Minor] Jitter backpressure
Diffstat (limited to 'src/plugins/fuzzy_check.c')
-rw-r--r--src/plugins/fuzzy_check.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 00c45a442..7691e5c71 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -2681,6 +2681,7 @@ fuzzy_check_timer_callback(int fd, short what, void *arg)
double backpressure_time = MAX(session->rule->io_timeout * 0.1, 0.1) * session->retransmits;
/* Do not make delay more than 500ms for performance considerations */
backpressure_time = MIN(backpressure_time, 0.5);
+ backpressure_time = rspamd_time_jitter(backpressure_time * 0.5, 0.0);
/* Inverse to distinguish */
msg_debug_fuzzy_check("backpressure for %.2f milliseconds (server=%s), retransmits: %d;",
backpressure_time * 1000,
@@ -2868,6 +2869,7 @@ fuzzy_controller_timer_callback(int fd, short what, void *arg)
double backpressure_time = MAX(session->rule->io_timeout * 0.1, 0.1) * session->retransmits;
/* Do not make delay more than 500ms for performance considerations */
backpressure_time = MIN(backpressure_time, 0.5);
+ backpressure_time = rspamd_time_jitter(backpressure_time * 0.5, 0.0);
/* Inverse to distinguish */
msg_debug_fuzzy_check("backpressure for %.2f milliseconds (server=%s), retransmits: %d;",
backpressure_time * 1000,