reuse TCP/TLS connections for XFR
Description
Profiling confirms we thought before: Not reusing TCP connections is a real performance drag for secondary servers which have to transfer lots of zones.
This is a profile for secondary with 100 k small zones being transferred from the same primary:
I.e. about 1/2 of CPU time spent by net
threads in bind(), spinning on CPU and looking for a free source port - because there's a lot of connections going on. (I did tune the OS to use 1k-64k port range before doing this test.)
Measured on v9_18_10, zone list comes via CATZ from the same primary.
Request
Reuse TCP/TLS connections when talking to the same primary.
Please note that reusing connections for ordinary queries is very intentionally out of scope for this ticket. It causes (or at least caused) all sorts of issues with broken implementations, and I hope that reusing it for zone transfers will be better.