]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add "-T maxcachesize=..." command line option
authorMichał Kępień <michal@isc.org>
Mon, 31 Aug 2020 11:15:33 +0000 (13:15 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 31 Aug 2020 21:41:24 +0000 (23:41 +0200)
commit3f25b8e608194110777e16eddccdf3b7e122dbdc
tree2dcfc3f96faccfff121d668915c7e759136af1b9
parent3abbbead55b9e9e563f813b04499c06591577ce0
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 aa72c31422bf04c34afd539dc9986a9bac976901

(cherry picked from commit 9ac1f6a9bce355948f413de60a74cbded0f6a2be)
bin/named/include/named/globals.h
bin/named/main.c
bin/named/server.c