]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: make tune.recv_enough configurable
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Dec 2015 11:04:35 +0000 (12:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Dec 2015 11:05:45 +0000 (12:05 +0100)
This setting used to be assigned to a variable tunable from a constant
and for an unknown reason never made its way into the config parser.

tune.recv_enough <number>
  Haproxy uses some hints to detect that a short read indicates the end of the
  socket buffers. One of them is that a read returns more than <recv_enough>
  bytes, which defaults to 10136 (7 segments of 1448 each). This default value
  may be changed by this setting to better deal with workloads involving lots
  of short messages such as telnet or SSH sessions.

doc/configuration.txt
src/cfgparse.c

index 2f179fdae6542931d433e9fa86f94436a5301050..960ab63722f76377927611bb8eff60a8b787d651 100644 (file)
@@ -593,6 +593,7 @@ The following keywords are supported in the "global" section :
    - tune.pipesize
    - tune.rcvbuf.client
    - tune.rcvbuf.server
+   - tune.recv_enough
    - tune.sndbuf.client
    - tune.sndbuf.server
    - tune.ssl.cachesize
@@ -1280,6 +1281,13 @@ tune.rcvbuf.server <number>
   order to save kernel memory by preventing it from buffering too large amounts
   of received data. Lower values will significantly increase CPU usage though.
 
+tune.recv_enough <number>
+  Haproxy uses some hints to detect that a short read indicates the end of the
+  socket buffers. One of them is that a read returns more than <recv_enough>
+  bytes, which defaults to 10136 (7 segments of 1448 each). This default value
+  may be changed by this setting to better deal with workloads involving lots
+  of short messages such as telnet or SSH sessions.
+
 tune.sndbuf.client <number>
 tune.sndbuf.server <number>
   Forces the kernel socket send buffer size on the client or the server side to
index 97f42430972c7fe891364591ae2463629d3b956d..efbf10dd52ec69ae511fb0d4a1b30ae980d6276d 100644 (file)
@@ -707,6 +707,16 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                }
                global.tune.chksize = atol(args[1]);
        }
+       else if (!strcmp(args[0], "tune.recv_enough")) {
+               if (alertif_too_many_args(1, file, linenum, args, &err_code))
+                       goto out;
+               if (*(args[1]) == 0) {
+                       Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
+                       err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
+               }
+               global.tune.recv_enough = atol(args[1]);
+       }
 #ifdef USE_OPENSSL
        else if (!strcmp(args[0], "tune.ssl.force-private-cache")) {
                if (alertif_too_many_args(0, file, linenum, args, &err_code))