Changeset 786

Show
Ignore:
Timestamp:
04/28/06 12:13:44 (4 years ago)
Author:
ahu
Message:

tune throttling, add unreachable accounting

Location:
trunk/pdns/pdns
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/rec_channel_rec.cc

    r739 r786  
    170170  addGetStat("throttled-outqueries", &SyncRes::s_throttledqueries); 
    171171  addGetStat("throttled-out", &SyncRes::s_throttledqueries); 
     172  addGetStat("unreachables", &SyncRes::s_unreachables); 
    172173 
    173174  addGetStat("query-rate", getQueryRate); 
  • trunk/pdns/pdns/syncres.cc

    r785 r786  
    4747unsigned int SyncRes::s_throttledqueries; 
    4848unsigned int SyncRes::s_nodelegated; 
     49unsigned int SyncRes::s_unreachables; 
     50 
    4951SyncRes::domainmap_t SyncRes::s_domainmap; 
    5052string SyncRes::s_serverID; 
     
    587589                g_stats.resourceLimits++; 
    588590              } 
    589               else 
     591              else { 
     592                s_unreachables++; d_unreachables++; 
    590593                LOG<<prefix<<qname<<": error resolving "<< (doTCP ? "over TCP" : "") << endl; 
     594              } 
    591595               
    592596              if(resolveret!=-2) { // don't account for resource limits, they are our own fault 
    593597                s_nsSpeeds[*tns].submit(1000000, &d_now); // 1 sec 
    594                 s_throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()),20,5); 
     598                if(resolveret==-1) 
     599                  s_throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // unreachable 
     600                else 
     601                  s_throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 20, 5);  // timeout 
    595602              } 
    596603              continue; 
     
    600607          wasLame:; // well, it didn't 
    601608            LOG<<prefix<<qname<<": status=NS "<<*tns<<" ("<<U32ToIP(*remoteIP)<<") is lame for '"<<auth<<"', trying sibling IP or NS"<<endl; 
    602             s_throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()),60,0); 
     609            s_throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); 
    603610          } 
    604611        } 
  • trunk/pdns/pdns/syncres.hh

    r785 r786  
    212212{ 
    213213public: 
    214   explicit SyncRes(const struct timeval& now) :  d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_now(now), 
    215                                                 d_cacheonly(false), d_nocache(false) { } 
     214  explicit SyncRes(const struct timeval& now) :  d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0), 
     215                                                 d_now(now), 
     216                                                 d_cacheonly(false), d_nocache(false) { } 
    216217  int beginResolve(const string &qname, const QType &qtype, uint16_t qclass, vector<DNSResourceRecord>&ret); 
    217218  void setId(int id) 
     
    238239  static unsigned int s_tcpoutqueries; 
    239240  static unsigned int s_nodelegated; 
     241  static unsigned int s_unreachables; 
    240242  unsigned int d_outqueries; 
    241243  unsigned int d_tcpoutqueries; 
    242244  unsigned int d_throttledqueries; 
    243245  unsigned int d_timeouts; 
     246  unsigned int d_unreachables; 
     247 
    244248  //  typedef map<string,NegCacheEntry> negcache_t; 
    245249