]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: haterm: increase thread-local pool size
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Feb 2026 14:30:01 +0000 (15:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Feb 2026 14:45:01 +0000 (15:45 +0100)
QUIC uses many objects and the default pool size causes a lot of
thrashing at the current request rate, taking ~12% CPU in pools.
Let's increase it to 3MB, which allows us to reach around 11M
req/s on a 80-core machine.

src/haterm_init.c

index acb6caf9667b1cb55d718a66af24a7524999a9d9..b59ce170f364638cf7edc6cd322a75fa7d7ad674 100644 (file)
@@ -330,6 +330,16 @@ void haproxy_init_args(int argc, char **argv)
                haterm_usage(progname);
        }
 
+       if (hbuf_is_null(&gbuf)) {
+               /* use 3MB of local cache per thread mainly for QUIC */
+               if (hbuf_alloc(&gbuf) == NULL) {
+                       ha_alert("failed to allocate a buffer.\n");
+                       goto leave;
+               }
+               hbuf_appendf(&gbuf, "global\n");
+               hbuf_appendf(&gbuf, "\ttune.memory.hot-size 3145728\n");
+       }
+
        /* "global" section */
        if (!hbuf_is_null(&gbuf))
                hbuf_appendf(&mbuf, "%.*s\n", (int)gbuf.data, gbuf.area);