From: Christopher Faulet Date: Mon, 22 Jun 2020 13:32:14 +0000 (+0200) Subject: MINOR: spoe: Don't systematically create new applets if processing rate is low X-Git-Tag: v2.1.8~59 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=1665e4a2d47b11da221491653606ed5025a3012d;p=haproxy-2.1.git MINOR: spoe: Don't systematically create new applets if processing rate is low When an event must be processed, we decide to create a new SPOE applet if there is no idle applet at all or if the processing rate is lower than the number of waiting events. But when the processing rate is very low (< 1 event/second), a new applet is created independently of the number of idle applets. Now, when there is at least one idle applet when there is only one event to process, no new applet is created. This patch is related to the issue #690. (cherry picked from commit eccfa612e8c9fd566f94dea9b0213b8b0d2d0531) Signed-off-by: Christopher Faulet --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 62a53c4..d13a04f 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2043,7 +2043,7 @@ spoe_queue_context(struct spoe_context *ctx) /* Check if we need to create a new SPOE applet or not. */ if (!eb_is_empty(&agent->rt[tid].idle_applets) && - agent->rt[tid].processing < read_freq_ctr(&agent->rt[tid].processing_per_sec)) + (agent->rt[tid].processing == 1 || agent->rt[tid].processing < read_freq_ctr(&agent->rt[tid].processing_per_sec))) goto end; SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"