]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
use LRU for packet cache instead of persistent cache marek/lru-cache-packets
authorMarek Vavruša <mvavrusa@cloudflare.com>
Sat, 12 May 2018 04:06:21 +0000 (21:06 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Wed, 16 May 2018 04:41:49 +0000 (21:41 -0700)
commit06a13b074f951132f7a7d776f68a0656ef4c31ee
tree1f803b64f4d338ef05d56c4672825fd63bd53743
parenta03a179eea208b84cc5fa3e551ef9083bb34eb1c
use LRU for packet cache instead of persistent cache

The primary motivation is that packet cache is shared with records,
but it isn't useful for improving performance of popular domain lookups.

Negative answers (with DNSSEC) are typically around 1kB, so it doesn't
take many queries to force a full cache flush, including useful record data.

This changes the packet cache to use a fixed-size LRU, which is more resilient
to random prefix attacks, but it isn't persistent or shared between processes.
lib/cache/api.c
lib/cache/api.h
lib/cache/entry_pkt.c
lib/cache/impl.h
lib/defines.h