From: Bert Hubert Date: Wed, 20 Jan 2010 21:39:52 +0000 (+0000) Subject: add max packet cache size + silence warning X-Git-Tag: rec-3.2~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd986b662ab77ac77842e099158a5858d35cf412;p=pdns add max packet cache size + silence warning git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1504 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 83c9d0f4e..6f338f6cc 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1042,11 +1042,11 @@ try struct timeval now; Utility::gettimeofday(&now, 0); - if(now.tv_sec - last_prune > 300 + 3*t_id) { + if(now.tv_sec - last_prune > (time_t)(300 + 3*t_id)) { DTime dt; dt.setTimeval(now); t_RC->doPrune(); // this function is local to a thread, so fine anyhow - t_packetCache->doPruneTo(); + t_packetCache->doPruneTo(::arg().asNum("max-packetcache-entries")); typedef SyncRes::negcache_t::nth_index<1>::type negcache_by_ttd_index_t; negcache_by_ttd_index_t& ttdindex=boost::multi_index::get<1>(SyncRes::t_sstorage->negcache); @@ -1860,6 +1860,7 @@ int main(int argc, char **argv) ::arg().set("max-negative-ttl", "maximum number of seconds to keep a negative cached entry in memory")="3600"; ::arg().set("max-cache-ttl", "maximum number of seconds to keep a cached entry in memory")="86400"; ::arg().set("packetcache-ttl", "maximum number of seconds to keep a cached entry in packetcache")="3600"; + ::arg().set("max-packetcache-entries", "maximum number of seconds to keep a cached entry in packetcache")="500000"; ::arg().set("packetcache-servfail-ttl", "maximum number of seconds to keep a cached servfail entry in packetcache")="60"; ::arg().set("server-id", "Returned when queried for 'server.id' TXT or NSID, defaults to hostname")=""; ::arg().set("remotes-ringbuffer-entries", "maximum number of packets to store statistics for")="0";