Skip to content

Reduce the default rbt hashtable size to 16 entries (4 bits)

The hash table rework MR (!3865 (merged), !3871 (merged)) increased the default RBT hashtable size to 16 bits (512KB). This works fine for RTB when used as a cache, but because there are three separate RBT tables for every zone loaded (RRs, NSEC, NSEC3) the memory usage would skyrocket when BIND 9 is used as authoritative DNS server with many zones.

The default RBT hashtable size before the rework was 64 entries, this commit reduces it to 16 entries because our educated guess is that most zones are just couple of entries (SOA, NS, A, AAAA, MX) and the rehashing small hashtables is actually cheap. The rework we did in the previous MR tries to avoid growing the hashtables for big-to-huge caches where the growing the hashtable comes with a price because the whole cache needs to be locked.

Closes #1775 (closed)

Merge request reports