]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #11484 from omoerbeek/rec-syncres-tables3
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Apr 2022 11:10:56 +0000 (13:10 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 11:10:56 +0000 (13:10 +0200)
rec: Use boost::mult-index for nsspeed table and make it shared.

1  2 
pdns/rec_channel_rec.cc
pdns/recursordist/rec-main.cc
pdns/syncres.cc
pdns/syncres.hh

Simple merge
index 009b0280a3e363005a42b49836baad46a335e4b7,06c184be1de445391bf92dbb3d213a5c38726178..aed5c66b7d7b83fdac0698d86274f4ad79099b19
@@@ -1864,21 -1871,11 +1864,15 @@@ static void houseKeeping(void*
      Utility::gettimeofday(&now);
  
      // Below are the tasks that run for every recursorThread, including handler and taskThread
 -    static thread_local PeriodicTask packetCacheTask{"packetCacheTask", 5};
 -    packetCacheTask.runIfDue(now, []() {
 -      t_packetCache->doPruneTo(g_maxPacketCacheEntries / (RecThreadInfo::numDistributors() + RecThreadInfo::numWorkers()));
 -    });
 +    if (t_packetCache) {
 +      static thread_local PeriodicTask packetCacheTask{"packetCacheTask", 5};
 +      packetCacheTask.runIfDue(now, []() {
 +        size_t sz = g_maxPacketCacheEntries / (RecThreadInfo::numWorkers() + RecThreadInfo::numDistributors());
 +        t_packetCache->setMaxSize(sz); // g_maxPacketCacheEntries might have changed by rec_control
 +        t_packetCache->doPruneTo(sz);
 +      });
 +    }
  
-     // This is a full scan
-     static thread_local PeriodicTask pruneNSpeedTask{"pruneNSSpeedTask", 100};
-     pruneNSpeedTask.runIfDue(now, [now]() {
-       SyncRes::pruneNSSpeeds(now.tv_sec - 300);
-     });
      static thread_local PeriodicTask pruneEDNSTask{"pruneEDNSTask", 5}; // period could likely be longer
      pruneEDNSTask.runIfDue(now, [now]() {
        SyncRes::pruneEDNSStatuses(now.tv_sec - 2 * 3600);
diff --cc pdns/syncres.cc
Simple merge
diff --cc pdns/syncres.hh
Simple merge