- tune.bufsize.small
- tune.cli.max-payload-size
- tune.comp.maxlevel
+ - tune.comp.res.ring
- tune.debug-file-directory
- tune.defaults.purge
- tune.disable-elf-symbols
Each stream using compression initializes the compression algorithm with
this value. The default value is 1.
+tune.comp.res.ring { on | off }
+ Enables ('on') or disables ('off') the allocation of a ring for compressed
+ responses which benefit from a history kept between flushes, which is
+ currently the case of server-sent events ("text/event-stream") with the
+ "gzip", "deflate" and "raw-deflate" algorithms when haproxy is built with
+ SLZ. Such events are flushed one at a time and usually repeat most of the
+ previous ones, which the ring allows to compress to a few percent of their
+ size instead of slightly inflating them. The ring costs about 4 kB per
+ stream, which may be saved this way, in which case these responses are
+ compressed as if their contents were of an unknown type. The ring is
+ never allocated for requests. It is enabled by default.
+
tune.debug-file-directory <dir>
Adds <dir> to the list of directories searched for the separate debug files
of stripped executables and libraries, whose symbols are used to name
}
+/* "tune.comp.res.ring": rings may be allocated for responses (default) */
+static int comp_res_ring __read_mostly = 1;
+
#ifdef USE_SLZ
/* Selects SLZ's content type matching <ctype> on the stream of <comp_ctx>
#endif /* USE_ZLIB */
+/* config parser for global "tune.comp.res.ring" */
+static int comp_parse_global_res_ring(char **args, int section_type, struct proxy *curpx,
+ const struct proxy *defpx, const char *file, int line,
+ char **err)
+{
+ if (too_many_args(1, args, err, NULL))
+ return -1;
+
+ if (strcmp(args[1], "on") == 0)
+ comp_res_ring = 1;
+ else if (strcmp(args[1], "off") == 0)
+ comp_res_ring = 0;
+ else {
+ memprintf(err, "'%s' expects 'on' or 'off'.", args[0]);
+ return -1;
+ }
+ return 0;
+}
/* config keyword parsers */
static struct cfg_kw_list cfg_kws = {ILH, {
{ CFG_GLOBAL, "tune.zlib.memlevel", zlib_parse_global_memlevel },
{ CFG_GLOBAL, "tune.zlib.windowsize", zlib_parse_global_windowsize },
#endif
+ { CFG_GLOBAL, "tune.comp.res.ring", comp_parse_global_res_ring },
{ 0, NULL, NULL }
}};