Bug 587 - statistics option does not default to 3600
statistics option does not default to 3600
Product: NSD
Classification: Unclassified
Component: NSD Code
Other Linux
: P5 enhancement
Assigned To: NSD team
Depends on:
  Show dependency treegraph
Reported: 2014-06-07 17:36 CEST by Simon Arlott
Modified: 2014-06-17 09:47 CEST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arlott 2014-06-07 17:36:01 CEST
The statistics option does not default to 3600 as the sample configuration states, it actually defaults to 0.

The value 0 now disables statistics reporting.

It appears that my nsd instances have only ever been reporting statistics when they get reloaded for a zone update, and with the change to check st.period != 0 they no longer report any statistics at all.
Comment 1 Simon Arlott 2014-06-07 18:18:25 CEST
Having a stats period of 0 has the side effect that the stats are never cumulative (unless SIGUSR1 is used), which makes the zone stats much easier to process.

Shouldn't the zone stats be reset after they're written?
There's no boot time in the zone stats file so I'd need to find the corresponding NSTATS line from syslog to determine when the statistics started.
Comment 2 Matthijs Mekking 2014-06-10 08:27:23 CEST
Hi Simon,

Thanks for your report. I fixed the default value for the statistics period in svn.

About your second question: I wouldn't know: it is an old Bind feature we copied, and I assume they behave the same.
Comment 3 Simon Arlott 2014-06-10 21:15:39 CEST
I couldn't find a zone stats feature in Bind 8, and the NSTATS code isn't in Bind 9 at all.

I've had to patch nsd to reset the zone data after writing it, otherwise it's not possible to use the stats output files on their own because you can't get an accurate value over time for any of the data.
Comment 4 Matthijs Mekking 2014-06-17 09:47:20 CEST
Hi Simon, 

actually the man page for nsd.conf says the default is 0. I undid my fix and adjusted the sampe configuration file to say explicit the default is 0.

About the cumulative statistics, Wouter explained to me the reason why we don't reset the statistics. Because the statistics are not dumped atomically, it could be that when resetting you have missed some increments of the counters. By providing cumulative statistics, the number at least adds up and is correct.