toaddr.sin_port=htons(53);
toaddr.sin_family=AF_INET;
-
int ret;
DTime dt;
/*
PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2005 PowerDNS.COM BV
+ Copyright (C) 2003 - 2005 PowerDNS.COM BV
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
L<<Logger::Error<<", outpacket/query ratio "<<(int)(SyncRes::s_outqueries*100.0/SyncRes::s_queries)<<"%";
L<<Logger::Error<<", "<<(int)(SyncRes::s_throttledqueries*100.0/(SyncRes::s_outqueries+SyncRes::s_throttledqueries))<<"% throttled, "
<<SyncRes::s_nodelegated<<" no-delegation drops"<<endl;
- L<<Logger::Error<<"queries running: "<<MT->numProcesses()<<endl;
+ L<<Logger::Error<<"stats: "<<MT->numProcesses()<<" queries running, "<<SyncRes::s_outgoingtimeouts<<" outgoing timeouts"<<endl;
}
+ else if(statsWanted)
+ L<<Logger::Error<<"stats: no stats yet!"<<endl;
+
statsWanted=false;
}
map<string,NegCacheEntry> SyncRes::s_negcache;
unsigned int SyncRes::s_queries;
+unsigned int SyncRes::s_outgoingtimeouts;
unsigned int SyncRes::s_outqueries;
unsigned int SyncRes::s_throttledqueries;
unsigned int SyncRes::s_nodelegated;
else {
s_outqueries++;
d_outqueries++;
- if(d_lwr.asyncresolve(remoteIP,qname.c_str(),qtype.getCode())!=1) { // <- we go out on the wire!
- LOG<<prefix<<qname<<": error resolving (perhaps timeout?)"<<endl;
+ int ret=d_lwr.asyncresolve(remoteIP,qname.c_str(),qtype.getCode());
+ if(ret != 1) { // <- we go out on the wire!
+ if(ret==0) {
+ LOG<<prefix<<qname<<": timeout resolving"<<endl;
+ d_timeouts++;
+ s_outgoingtimeouts++;
+ }
+ else
+ LOG<<prefix<<qname<<": error resolving"<<endl;
+
nsSpeeds[toLower(*tns)].submit(1000000); // 1 sec
- d_timeouts++;
+
s_throttle.throttle(d_now, remoteIP+"|"+qname+"|"+qtype.getName(),20,5);
continue;
}
d_nocache=state;
}
static unsigned int s_queries;
+ static unsigned int s_outgoingtimeouts;
static unsigned int s_throttledqueries;
static unsigned int s_outqueries;
static unsigned int s_nodelegated;