mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-04 00:38:02 +00:00
MINOR: config: implement global setting tune.buffers.reserve
Used in conjunction with the dynamic buffer allocator. tune.buffers.reserve <number> Sets the number of buffers which are pre-allocated and reserved for use only during memory shortage conditions resulting in failed memory allocations. The minimum value is 2 and is also the default. There is no reason a user would want to change this value, it's mostly aimed at haproxy core developers.
This commit is contained in:
parent
a24adf0795
commit
1058ae73f1
@ -891,6 +891,12 @@ spread-checks <0..50, in percent>
|
||||
and +/- 50%. A value between 2 and 5 seems to show good results. The
|
||||
default value remains at 0.
|
||||
|
||||
tune.buffers.reserve <number>
|
||||
Sets the number of buffers which are pre-allocated and reserved for use only
|
||||
during memory shortage conditions resulting in failed memory allocations. The
|
||||
minimum value is 2 and is also the default. There is no reason a user would
|
||||
want to change this value, it's mostly aimed at haproxy core developers.
|
||||
|
||||
tune.bufsize <number>
|
||||
Sets the buffer size to this size (in bytes). Lower values allow more
|
||||
sessions to coexist in the same amount of RAM, and higher values allow some
|
||||
|
@ -696,6 +696,16 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp(args[0], "tune.buffers.reserve")) {
|
||||
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.reserved_bufs = atol(args[1]);
|
||||
if (global.tune.reserved_bufs < 2)
|
||||
global.tune.reserved_bufs = 2;
|
||||
}
|
||||
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user