]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: haload: enable per-thread-group FD tables when available
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 27 Aug 2026 12:59:48 +0000 (14:59 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 28 Aug 2026 15:41:45 +0000 (17:41 +0200)
Add <_GNU_SOURCE> so <CLONE_FILES> is visible from <sched.h>. When it
is, generate "expose-experimental-directives" and "tune.fd.tables
per-thread-group" in the global section.

src/haload_init.c

index b5f15e21832c0e587cfcca9bfdbebba3ec1f8f21..5e86e3fac1317fff3154315d94d1b6467b098584 100644 (file)
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <errno.h>
 
 #include <haproxy/connection.h>
@@ -431,6 +432,11 @@ void haproxy_init_args(int argc, char **argv)
        hbuf_appendf(&gbuf, "global\n");
        hbuf_appendf(&gbuf, "\ttune.memory.hot-size 3145728\n");
        hbuf_appendf(&gbuf, "\tssl-server-verify none\n");
+#ifdef CLONE_FILES
+       /* required for "tune.fd.tables" below */
+       hbuf_appendf(&gbuf, "\texpose-experimental-directives\n");
+       hbuf_appendf(&gbuf, "\ttune.fd.tables per-thread-group\n");
+#endif
 
        if (hbuf_alloc(&buf) == NULL) {
                ha_alert("failed to allocate a buffer\n");