On Fri, 12 Aug 2022 12:53:39 +0300 Michael Tokarev <
m...@tls.msk.ru> wrote:
> What does cachedb/redis bring us, how these can be used?
It will allow us to keep cache during reboot.
For example:
I set up a new Debian bookworm box where I am using unbound as resolver
(default configuration; apt-get install unbound && systemctl start unbound):
> $ cat /etc/resolv.conf
> nameserver 127.0.0.1
With primed cache,
> $ time ping -q -c 1
google.com
> PING
google.com(
fra24s06-in-x0e.1e100.net (2a00:1450:4001:829::200e)) 56 data bytes
>
> ---
google.com ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 3.730/3.730/3.730/0.000 ms
>
> real 0m0.007s
> user 0m0.000s
> sys 0m0.003s
If I do the same after reboot when unbound service has started:
> $ time ping -q -c 1
google.com
> PING
google.com(
fra24s07-in-x0e.1e100.net (2a00:1450:4001:82a::200e)) 56 data bytes
>
> ---
google.com ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 3.621/3.621/3.621/0.000 ms
>
> real 0m3.254s
> user 0m0.003s
> sys 0m0.000s
Keep in mind that you will experience this delay for _every_ TLD due to
DNSSEC records.
Or imagine a remote box where you try to SSH into which will be delayed
for ~3s because this box has to do PTR lookup for your IP address.
Configuring cache db feature in unbound would allow me to store unbound
cache in Redis for example so unbound can provide fast answers directly
after boot.
--
Regards,
Thomas