mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Add "-T maxcachesize=..." command line option
An implicit default of "max-cache-size 90%;" may cause memory use issues
on hosts which run numerous named instances in parallel (e.g. GitLab CI
runners) due to the cache RBT hash table now being pre-allocated [1] at
startup. Add a new command line option, "-T maxcachesize=...", to allow
the default value of "max-cache-size" to be overridden at runtime. When
this new option is in effect, it overrides any other "max-cache-size"
setting in the configuration, either implicit or explicit. This
approach was chosen because it is arguably the simplest one to
implement.
The following alternative approaches to solving this problem were
considered and ultimately rejected (after it was decided they were not
worth the extra code complexity):
- adding the same command line option, but making explicit
configuration statements have priority over it,
- adding a build-time option that allows the implicit default of
"max-cache-size 90%;" to be overridden.
[1] see commit e24bc324b4
This commit is contained in:
@@ -650,6 +650,8 @@ parse_T_opt(char *option) {
|
||||
named_g_nosyslog = true;
|
||||
} else if (!strcmp(option, "notcp")) {
|
||||
notcp = true;
|
||||
} else if (!strncmp(option, "maxcachesize=", 13)) {
|
||||
named_g_maxcachesize = atoi(option + 13);
|
||||
} else if (!strcmp(option, "maxudp512")) {
|
||||
maxudp = 512;
|
||||
} else if (!strcmp(option, "maxudp1460")) {
|
||||
|
Reference in New Issue
Block a user