]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Adjustable statistics interval 5271/head
authorphonedph1 <phoned@gmail.com>
Mon, 24 Apr 2017 17:33:04 +0000 (17:33 +0000)
committerphonedph1 <phoned@gmail.com>
Mon, 24 Apr 2017 17:33:04 +0000 (17:33 +0000)
docs/markdown/recursor/settings.md
pdns/pdns_recursor.cc

index c25162599876dd99abafcb1e0ae0c7db8575da1b..159a307ca749c474d23cd38766cd984a88d34f8d 100644 (file)
@@ -93,6 +93,14 @@ have to tick an 'RFC 2181 compliant' box.
 Zones read from these files (in BIND format) are served authoritatively. DNSSEC is not supported. Example:
 `auth-zones=example.org=/var/zones/example.org, powerdns.com=/var/zones/powerdns.com`.
 
+## `statistics-interval`
+* Integer
+* Default: 1800
+* Available since: 4.1.0
+
+Interval between logging statistical summary on recursor performance.
+Use 0 to disable.
+
 ## `carbon-interval`
 * Integer
 * Default: 30
index 8db27972925ab477fbb8865ecdbf185a62f92d1f..376be53581edbc9e9277f7cfc7a940a82e7421d6 100644 (file)
@@ -155,6 +155,7 @@ static bool g_weDistributeQueries; // if true, only 1 thread listens on the inco
 static bool g_reusePort{false};
 static bool g_useOneSocketPerThread;
 static bool g_gettagNeedsEDNSOptions{false};
+static time_t g_statisticsInterval;
 
 std::unordered_set<DNSName> g_delegationOnly;
 RecursorControlChannel s_rcc; // only active in thread 0
@@ -2084,7 +2085,7 @@ static void houseKeeping(void *)
     }
 
     if(!t_id) {
-      if(now.tv_sec - last_stat >= 1800) {
+      if(g_statisticsInterval > 0 && now.tv_sec - last_stat >= g_statisticsInterval) {
        doStats();
        last_stat=time(0);
       }
@@ -2832,6 +2833,8 @@ static int serviceMain(int argc, char*argv[])
 
   g_gettagNeedsEDNSOptions = ::arg().mustDo("gettag-needs-edns-options");
 
+  g_statisticsInterval = ::arg().asNum("statistics-interval");
+
 #ifdef SO_REUSEPORT
   g_reusePort = ::arg().mustDo("reuseport");
 #endif
@@ -3157,6 +3160,7 @@ int main(int argc, char **argv)
     ::arg().set("carbon-ourname", "If set, overrides our reported hostname for carbon stats")="";
     ::arg().set("carbon-server", "If set, send metrics in carbon (graphite) format to this server IP address")="";
     ::arg().set("carbon-interval", "Number of seconds between carbon (graphite) updates")="30";
+    ::arg().set("statistics-interval", "Number of seconds between printing of recursor statistics, 0 to disable")="1800";
     ::arg().set("quiet","Suppress logging of questions and answers")="";
     ::arg().set("logging-facility","Facility to log messages as. 0 corresponds to local0")="";
     ::arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR;