Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustable statistics interval #5271

Merged
merged 1 commit into from
May 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/markdown/recursor/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion pdns/pdns_recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down