[Pdns-dev] What will pdns do when a fast dns server become slow and become fast again?

bert hubert bert.hubert at netherlabs.nl
Fri Dec 27 12:48:31 CET 2013


Hi Aki, Jacky,

This is explained in http://doc.powerdns.com/html/recursor-design-and-engineering.html#idp10119168 :

"Whenever a packet is sent to a remote nameserver, the response time is stored in the SyncRes::s_nsSpeeds map, using an exponentially weighted moving average. This EWMA averages out different response times, and also makes them decrease over time. This means that a nameserver that hasn't been queried recently gradually becomes faster in the eyes of PowerDNS, giving it a chance again."


	Bert

On 27 Dec 2013, at 08:50, Aki Tuomi <cmouse at youzen.ext.b2.fi> wrote:

> once cache expires the records are removed and are looked for again. if you look
> at SyncRes::getAddrs, you'll see the record selection process. 
> 
> btw, are you just interested or is there some deeper issue here? 
> 
> Aki
> 
> 
> On Fri, Dec 27, 2013 at 03:29:27PM +0800, jacky wrote:
>> hi, Aki tnuomi,  
>> Thank you for  suggestion. I found pdns always get the fastest one from the front of result returned by function "SyncRes::shuffleInSpeedOrder”. If a slow one at the back has no opportunity to be choosed, how pdns know it become fast. I can not find the source code make pdns query the slow one.  
>> 
>> on the other hand, I found there is a houseKeeping thread which will erase the stale speed value of a dns server . If a slow dns at the back of t_sstorage->nsSpeeds map, it will be erased because of rarely to be queried, and only fast dns server will have its speed updated by this code "  t_sstorage->nsSpeeds[*tns].submit(*remoteIP, lwr.d_usec, &d_now);” at syncres.cc:1003.
>> . And then, only dns servers which are mostly queried will stay in t_sstorage->nsSpeeds map. It make me puzzled.
>> 
>> --  
>> jacky
>> 
>> 
>> On Friday, December 27, 2013 at 3:08 PM, Aki Tuomi wrote:
>> 
>>> On Thu, Dec 26, 2013 at 10:34:23PM +0800, jacky wrote:
>>>> hi, all,  
>>>> I think may be it is a question more suitable to dev maillist, so I submit it here. If I made a mistake , please let me know. Thanks.
>>>> 
>>>> I'am reading the source code of pdns-recursor-3.5.3. There is question I can not understand.
>>>> When a authoritative dns server become slow because of overload, pdns-recursor will move it backwards in the  
>>>> t_sstorage->nsSpeeds map, and then a faster dns server will be used preferred. But when the dns server recoverd  
>>>> from overload and become fast again, what will pdns-recursor do about it ? Will pdns-recursor move it forward  
>>>> in speed map? I can't find relevant source code. Any suggestion?
>>>> 
>>>> --  
>>>> jacky
>>>> 
>>> 
>>> 
>>> Hi!
>>> 
>>> It works by moving the fastest one on top.  
>>> 
>>>> _______________________________________________
>>>> Pdns-dev mailing list
>>>> Pdns-dev at mailman.powerdns.com (mailto:Pdns-dev at mailman.powerdns.com)
>>>> http://mailman.powerdns.com/mailman/listinfo/pdns-dev
>>>> 
>>> 
>>> 
>>> 
>> 
>> 
> _______________________________________________
> Pdns-dev mailing list
> Pdns-dev at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-dev




More information about the Pdns-dev mailing list