- spread-checks
- tune.bufsize
- tune.chksize
+ - tune.comp.maxlevel
- tune.http.maxhdr
- tune.maxaccept
- tune.maxpollevents
build time. It is not recommended to change this value, but to use better
checks whenever possible.
+tune.comp.maxlevel <number>
+ Sets the maximum compression level. The compression level affects CPU
+ usage during compression. This value affects CPU usage during compression.
+ Each session using compression initializes the compression algorithm with
+ this value. The default value is 1.
+
tune.http.maxhdr <number>
Sets the maximum number of headers in a request. When a request comes with a
number of headers greater than this value (including the first line), it is
void *zlib_pending_buf;
void *zlib_head;
#endif /* USE_ZLIB */
+ int cur_lvl;
};
struct comp_algo {
int zlibmemlevel; /* zlib memlevel */
int zlibwindowsize; /* zlib window size */
#endif
+ int comp_maxlevel; /* max HTTP compression level */
} tune;
struct {
char *prefix; /* path prefix of unix bind socket */
goto out;
#endif
}
+ else if (!strcmp(args[0], "tune.comp.maxlevel")) {
+ if (*args[1]) {
+ global.tune.comp_maxlevel = atoi(args[1]);
+ if (global.tune.comp_maxlevel < 1 || global.tune.comp_maxlevel > 9) {
+ Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n",
+ file, linenum, args[0]);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+ } else {
+ Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n",
+ file, linenum, args[0]);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+ }
else if (!strcmp(args[0], "uid")) {
if (global.uid != 0) {
Alert("parsing [%s:%d] : user/uid already specified. Continuing.\n", file, linenum);
.zlibmemlevel = 8,
.zlibwindowsize = MAX_WBITS,
#endif
+ .comp_maxlevel = 1,
},
ctx.idx = 0;
/* initialize compression */
- if (s->comp_algo->init(&s->comp_ctx, 1) < 0)
+ if (s->comp_algo->init(&s->comp_ctx, global.tune.comp_maxlevel) < 0)
goto fail;
+ s->comp_ctx.cur_lvl = global.tune.comp_maxlevel;
+
/* remove Content-Length header */
if ((msg->flags & HTTP_MSGF_CNT_LEN) && http_find_header2("Content-Length", 14, res->p, &txn->hdr_idx, &ctx))
http_remove_header2(msg, &txn->hdr_idx, &ctx);