]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Increase catalog zone entries hash table's bits size
authorAram Sargsyan <aram@isc.org>
Wed, 11 Jan 2023 17:23:21 +0000 (17:23 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 11 Jan 2023 17:26:26 +0000 (17:26 +0000)
The hash table implementation in the current branch does not
support automatic resize operation, so the initial value of
the table should be chosen carefully.

Catalog zones entries hash table's size is currently only 4 bits,
which is very low for a catalog zone with thousands of entries,
and causes CPU consumption spikes when working with the hash
table to add/delete/search entries.

Use 16 bits instead, which should make working with big catalog
zones much faster at the expense of slightly higher memory usage,
i.e. 512 KiB for a 64-bit system for each catalog zone.

lib/dns/catz.c

index 8a552d12595ca501f1c5a4c2a811f34b18479aa0..35b3fb2f551c098e7539c0cdc39a20ed78c2001a 100644 (file)
@@ -662,7 +662,7 @@ dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
        dns_name_init(&new_zone->name, NULL);
        dns_name_dup(name, catzs->mctx, &new_zone->name);
 
-       isc_ht_init(&new_zone->entries, catzs->mctx, 4);
+       isc_ht_init(&new_zone->entries, catzs->mctx, 16);
 
        new_zone->updatetimer = NULL;
        result = isc_timer_create(catzs->timermgr, isc_timertype_inactive, NULL,