HTTP content-based health checks will be involved in searching text in pages.
Some pages may not fit in the default buffer (16kB) and sometimes it might be
desired to have larger buffers in order to find patterns. Running checks on
smaller URIs is always preferred of course.
(cherry picked from commit
043f44aeb835f3d0b57626c4276581a73600b6b1)
- nosplice
- spread-checks
- tune.bufsize
+ - tune.chksize
- tune.maxaccept
- tune.maxpollevents
- tune.maxrewrite
possibly causing the system to run out of memory. At least the global maxconn
parameter should be decreased by the same factor as this one is increased.
+tune.chksize <number>
+ Sets the check buffer size to this size (in bytes). Higher values may help
+ find string or regex patterns in very large pages, though doing so may imply
+ more memory and CPU usage. The default value is 16384 and can be changed at
+ build time. It is not recommended to change this value, but to use better
+ checks whenever possible.
+
tune.maxaccept <number>
Sets the maximum number of consecutive accepts that a process may perform on
a single wake up. High values give higher priority to high connection rates,
int client_rcvbuf; /* set client rcvbuf to this value if not null */
int server_sndbuf; /* set server sndbuf to this value if not null */
int server_rcvbuf; /* set server rcvbuf to this value if not null */
+ int chksize; /* check buffer size in bytes, defaults to BUFSIZE */
} tune;
struct listener stats_sock; /* unix socket listener for statistics */
struct proxy *stats_fe; /* the frontend holding the stats settings */
}
global.tune.maxaccept = atol(args[1]);
}
+ else if (!strcmp(args[0], "tune.chksize")) {
+ 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.chksize = atol(args[1]);
+ }
else if (!strcmp(args[0], "tune.bufsize")) {
if (*(args[1]) == 0) {
Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
}
/* Allocate buffer for partial check results... */
- if ((newsrv->check_data = calloc(BUFSIZE, sizeof(char))) == NULL) {
+ if ((newsrv->check_data = calloc(global.tune.chksize, sizeof(char))) == NULL) {
Alert("parsing [%s:%d] : out of memory while allocating check buffer.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
*/
done = 0;
- for (len = 0; s->check_data_len < BUFSIZE; s->check_data_len += len) {
- len = recv(fd, s->check_data + s->check_data_len, BUFSIZE - s->check_data_len, 0);
+ for (len = 0; s->check_data_len < global.tune.chksize; s->check_data_len += len) {
+ len = recv(fd, s->check_data + s->check_data_len, global.tune.chksize - s->check_data_len, 0);
if (len <= 0)
break;
}
/* Intermediate or complete response received.
* Terminate string in check_data buffer.
*/
- if (s->check_data_len < BUFSIZE)
+ if (s->check_data_len < global.tune.chksize)
s->check_data[s->check_data_len] = '\0';
else {
s->check_data[s->check_data_len - 1] = '\0';
.tune = {
.bufsize = BUFSIZE,
.maxrewrite = MAXREWRITE,
+ .chksize = BUFSIZE,
},
/* others NULL OK */
};