diff --git a/CHANGES b/CHANGES index 44461ac4a9..525a6c4498 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2019. [tuning] Reduce the amount of work performed per quantum + when cleaning the cache. [RT #15986] + 2018. [bug] Checking if the HMAC MD5 private file was broken. [RT #15960] diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 8f1fb11a1e..2019aeaae6 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cache.c,v 1.69 2006/05/04 02:24:06 marka Exp $ */ +/* $Id: cache.c,v 1.70 2006/05/16 03:54:35 marka Exp $ */ /*! \file */ @@ -212,15 +212,16 @@ adjust_increment(cache_cleaner_t *cleaner, unsigned int remaining, } new = (names * interval); - new /= usecs; + new /= (usecs * 2); if (new == 0) new = 1; - else if (new > DNS_CACHE_CLEANERINCREMENT) - new = DNS_CACHE_CLEANERINCREMENT; /* Smooth */ new = (new + cleaner->increment * 7) / 8; + if (new > DNS_CACHE_CLEANERINCREMENT) + new = DNS_CACHE_CLEANERINCREMENT; + cleaner->increment = (unsigned int)new; isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,