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

PowerDNS Recursor qa-latency statistic failures #424

Closed
Habbie opened this issue Apr 26, 2013 · 1 comment
Closed

PowerDNS Recursor qa-latency statistic failures #424

Habbie opened this issue Apr 26, 2013 · 1 comment

Comments

@Habbie
Copy link
Member

Habbie commented Apr 26, 2013

In pdns_recursor.cc is this calculation for each user query:

g_stats.avgLatencyUsec=(uint64_t)((1-0.0001)*g_stats.avgLatencyUsec + 0.0001*newLat);

This does not work if newLat<10000 (10ms). Because the uint64_t cast is cutting the decimal places and avgLatencyUsec retains its value minus 1/10000 of it. But it would work if avgLatencyUsec type is a double.[[BR]][[BR]]

Another point is this condition:

uint64_t newLat=(uint64_t)(spent*1000000);
if(newLat < 1000000); // outliers of several minutes exist..
  ...

This means that timeouts does never count because the default network-timeout is 1500ms. That's bad. We suggest this:

uint64_t newLat=(uint64_t)(spent*1000000);
newLat = min(newLat,(uint64_t)(g_networkTimeoutMsec*1000));

And in this context we have a suggestion for a new Recursor setting:

::arg().set("latency-statistic-size","Number of latency values to calculate the qa-latency average")="10000";

With this option we can change the smoothing factor of the qa-latency value.

Attached you will find our suggestions as a patch. It's probably faulty coded. But it works for us.

@ghost ghost assigned Habbie Apr 26, 2013
@Habbie
Copy link
Member Author

Habbie commented Apr 26, 2013

Attachment '' (avgLatency.patch) https://gist.github.com/5466728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant