]> granicus.if.org Git - pdns/commitdiff
add qa-latency to rrd, add throttle-entries to rrd, add 'QUIT' command,
authorBert Hubert <bert.hubert@netherlabs.nl>
Thu, 23 Mar 2006 18:21:32 +0000 (18:21 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Thu, 23 Mar 2006 18:21:32 +0000 (18:21 +0000)
make cache-size calculation do less work (rrd stats caused packet loss!),
make twice-hourly stats no longer calculate cache size (caused packet loss)

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@614 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc
pdns/rec_channel_rec.cc
pdns/recursor_cache.cc
pdns/tools/rrd/create
pdns/tools/rrd/index.html
pdns/tools/rrd/makegraphs
pdns/tools/rrd/update

index 6e12b5069feb0a41e44c5a0b139307f5926da86c..d796c4b9b1f28c6b3540a79fd756aa6e1cd99c93 100644 (file)
@@ -521,7 +521,7 @@ void doStats(void)
     L<<Logger::Error<<"stats: "<<qcounter<<" questions, "<<RC.size()<<" cache entries, "<<SyncRes::s_negcache.size()<<" negative entries, "
      <<(int)((RC.cacheHits*100.0)/(RC.cacheHits+RC.cacheMisses))<<"% cache hits"<<endl;
     L<<Logger::Error<<"stats: throttle map: "<<SyncRes::s_throttle.size()<<", ns speeds: "
-     <<SyncRes::s_nsSpeeds.size()<<", bytes: "<<RC.bytes()<<endl;
+     <<SyncRes::s_nsSpeeds.size()<<endl; // ", bytes: "<<RC.bytes()<<endl;
     L<<Logger::Error<<"stats: 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;
index f5747cf239ce1cc120d5e77a912c555e067d3503..88f6c550bf9d3e28452dec7e6344e0160f8cc7de 100644 (file)
@@ -121,6 +121,9 @@ string RecursorControlParser::getAnswer(const string& question)
 
   if(words[0]=="GET") 
     return doGet(begin, end);
+
+  if(words[0]=="QUIT") 
+    exit(1);
   
   return "Unknown command '"+cmd+"'\n";
 
index df2ccf20a732f3438663e24cc1a2b75462fd0657..34ea25b94fe5b83fb65d13700657dea1daa13da5 100644 (file)
@@ -58,11 +58,7 @@ string DNSRR2String(const DNSResourceRecord& rr)
 
 unsigned int MemRecursorCache::size()
 {
-  unsigned int ret=0;
-  for(cache_t::const_iterator i=d_cache.begin(); i!=d_cache.end(); ++i) {
-    ret+=i->d_records.size();
-  }
-  return ret;
+  return d_cache.size();
 }
 
 unsigned int MemRecursorCache::bytes()
@@ -210,8 +206,8 @@ void MemRecursorCache::doPrune(void)
   //  cout<<"Walk took "<< dt.udiff()<<"usec\n";
   //  dt.set();
   ttdindex.erase(ttdindex.begin(), j);
-  //  cout<<"Erase took "<< dt.udiff()<<" usec, looked: "<<looked<<", quick: "<<quickZonk<<", full: ";
 //  cout<<fullZonk<<", partial: "<<partialZonk<<", no: "<<noZonk<<"\n";
+//    cout<<"Erase took "<< dt.udiff()<<" usec, looked: "<<looked<<", quick: "<<quickZonk<<", full: ";
//   cout<<fullZonk<<", partial: "<<partialZonk<<", no: "<<noZonk<<"\n";
   //  cache_t(d_cache).swap(d_cache);
 }
 
index 62ae868017b4a14aa4f571618185b81d22ff6c17..7bf289fcc7c19e7293dcd00786d6a3bd28071932 100755 (executable)
@@ -1,6 +1,7 @@
 rrdtool create pdns_recursor.rrd -s 60 \
 DS:questions:COUNTER:600:0:100000 \
 DS:cache-entries:GAUGE:600:0:U \
+DS:throttle-entries:GAUGE:600:0:U \
 DS:concurrent-queries:GAUGE:600:0:50000 \
 DS:noerror-answers:COUNTER:600:0:100000 \
 DS:nxdomain-answers:COUNTER:600:0:100000 \
@@ -18,6 +19,7 @@ DS:answers1-10:COUNTER:600:0:100000 \
 DS:answers10-100:COUNTER:600:0:100000 \
 DS:answers100-1000:COUNTER:600:0:100000 \
 DS:answers-slow:COUNTER:600:0:100000 \
+DS:qa-latency:COUNTER:600:0:10000000 \
        RRA:AVERAGE:0.5:1:9600  \
        RRA:AVERAGE:0.5:4:9600  \
        RRA:AVERAGE:0.5:24:6000 \
index 8a1feb0c8e75d63e4cb908118f23ef96599ed1c4..5bb7391ce79b20250eba1c9275c59fb20e7da377 100644 (file)
@@ -29,6 +29,8 @@ be answered without generating any out-queries</td></tr>
 </table>
 <img src="latencies-day.png">
 <br>
+<img src="qa-latency-day.png">
+<br>
 <img src="qoutq-day.png">
 <br>
 <img src="timeouts-day.png">
@@ -37,6 +39,8 @@ be answered without generating any out-queries</td></tr>
 <br>
 <img src="caches-day.png">
 <br>
+<img src="caches2-day.png">
+<br>
 <img src="load-day.png">
 <br>
 <img src="hitrate-day.png">
index 62911ca48350cd3ecb9b680050bce8545b67dd4d..a9e4c3e70b46ffb264bf2c6305c2ea4ace9cb210 100755 (executable)
@@ -41,6 +41,14 @@ function makeGraphs()
         LINE2:questions#ff0000:"questions/s"\
         LINE2:alloutqueries#00ff00:"outqueries/s"
 
+  rrdtool graph --start -$1 $WWWPREFIX/qa-latency-$2.png -w $WSIZE -h $HSIZE -l 0 \
+       -t "Questions/answer latency in milliseconds" \
+       -v "msec" \
+       DEF:qalatency=pdns_recursor.rrd:qa-latency:AVERAGE  \
+       CDEF:mqalatency=qalatency,1000,/ \
+        LINE2:mqalatency#ff0000:"questions/s"
+
+
   rrdtool graph --start -$1 $WWWPREFIX/timeouts-$2.png -w $WSIZE -h $HSIZE -l 0\
        -t "Outqueries/timeouts counts per second" \
        -v "events" \
@@ -58,11 +66,23 @@ function makeGraphs()
        DEF:cacheentries=pdns_recursor.rrd:cache-entries:AVERAGE  \
        DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE  \
        DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE  \
+       DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE  \
         LINE2:cacheentries#ff0000:"cache entries" \
         LINE2:negcacheentries#0000ff:"negative cache entries" \
-        LINE2:nsspeedsentries#00ff00:"NS speeds entries"
+        LINE2:nsspeedsentries#00ff00:"NS speeds entries" \
+        LINE2:throttleentries#00ff00:"throttle map entries" 
         
 
+  rrdtool graph --start -$1 $WWWPREFIX/caches2-$2.png -w $WSIZE -h $HSIZE -l 0\
+       -t "Cache sizes" \
+       -v "entries" \
+       DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE  \
+       DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE  \
+       DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE  \
+        LINE2:negcacheentries#0000ff:"negative cache entries" \
+        LINE2:nsspeedsentries#00ff00:"NS speeds entries" \
+        LINE2:throttleentries#ffa000:"throttle map entries" 
+
   rrdtool graph --start -$1 $WWWPREFIX/load-$2.png -w $WSIZE -h $HSIZE -l 0\
        -v "MThreads" \
        -t "Concurrent queries" \
index f8203f01338451ddcc602849ce4e45544818d12c..caa905eaa36132c5b3a62d24bb27c1341df487a2 100755 (executable)
@@ -6,7 +6,8 @@ VARIABLES="questions cache-entries concurrent-queries\
           nxdomain-answers noerror-answers\
           servfail-answers tcp-outqueries\
           outgoing-timeouts nsspeeds-entries negcache-entries all-outqueries throttled-out\
-          cache-hits cache-misses answers0-1 answers1-10 answers10-100 answers100-1000 answers-slow"
+          cache-hits cache-misses answers0-1 answers1-10 answers10-100 answers100-1000 answers-slow\
+       qa-latency throttle-entries"
 
 UVARIABLES=$(echo $VARIABLES | tr '[a-z]' '[A-Z]' | tr - _     )