]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: spoe: Don't systematically create new applets if processing rate is low
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Jun 2020 13:32:14 +0000 (15:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jun 2020 19:50:20 +0000 (21:50 +0200)
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.

src/flt_spoe.c

index 4790f5945814e5dd4e5117f20ce631f78f8e1172..62e535ef118834a545e0795841b8b1b29b26abcf 100644 (file)
@@ -2010,7 +2010,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"