]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Skip some memory allocations in client mode
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 25 May 2021 14:35:13 +0000 (16:35 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 25 May 2021 14:35:13 +0000 (16:35 +0200)
commita093b261aae431777482a58bdcae8ebe33203084
tree205e0f4d7ac5565ba98b6b155890b0f7ba3b1159
parentdc072e0ddca019b5bcd61448f3bb6c41edc72eb7
dnsdist: Skip some memory allocations in client mode

dnsdist does not use most of the configuration in client mode, mostly
caring about the settings needed to access the console, but
we still need to parse all directives and create objects due to the
way our Lua parsing works.
We don't, however, need to allocate the whole storage needed for
packet caches, for backend states or for the in-memory ring buffers.
This reduces the memory consumption of a console client to roughly 1 MB
from hundreds of them in some cases.
pdns/dnsdist-lua.cc
pdns/dnsdist-lua.hh
pdns/dnsdistdist/dnsdist-backend.cc
pdns/dnsdistdist/dnsdist-lua-bindings-packetcache.cc