rndc can get very very slow if large number of requests is made over short period of time
Summary
rndc can get very very slow if large number of requests is made over short period of time. Primary cause seems to be that packet deduplication goes O(n^2).
BIND version used
- Affects v9.19 : e2bbf38c
- I assume that supported versions are affected
Steps to reproduce
TL;DR call rndc addzone
in a tight loop, and measure response time.
Helper scripts:
- addconfprim.py - run this
- rndc.py
What is the current bug behavior?
Adding zones slows down very quickly.
33000 zones present; adding last 1000 took 1.93 secs
...
65000 zones present; adding last 1000 took 4.42 secs
What is the expected correct behavior?
No speed degradation.
Relevant configuration files
key "key" {
algorithm hmac-sha256;
secret "ptCZS/77Xm2sIzCdO/oxEoer2BbDgCfvF0CrqrcdRWM=";
};
options {
max-cache-size 10M;
recursion no;
notify no;
allow-new-zones yes;
lmdb-mapsize 110M;
};
Possible fixes
From a quick glance, the problem centers around DUP_LIFETIME
defined in lib/isccc/cc.c
and in the inefficiency of isccc_cc_cleansymtab()
and it's use.