From 26ac157abccadd0e62868f35438fb04ff41d7195 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 23 Apr 2024 15:40:43 +0100 Subject: [Minor] Jitter backpressure --- src/plugins/fuzzy_check.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/fuzzy_check.c') 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, -- cgit v1.2.3