码迷,mamicode.com
首页 > 其他好文 > 详细

ntp配置中的tinker参数

时间:2017-04-24 18:59:05      阅读:2937      评论:0      收藏:0      [点我收藏+]

标签:val   官方   mini   相关   cee   source   选项参数   com   put   

今天就ntp的tinker来做专项学习。此处的tinker指的是ntp.conf配置文件中的一个配置指令名。它还有相关的配置选项

经过查看官方文档其中对ntp.conf中的tinker是如下描述的:

官方文档:http://doc.ntp.org/4.2.6/miscopt.html

技术分享

意思是这个tinker指令是改变由时钟纪律算法使用的某些系统变量,这些变量的默认值已经针对广泛的网络速度和可靠性期望进行了精心优化,很少有必要去改变它的默认值,除非有的人忍不住非要去转动旋钮(即修改tinker指令对应的选项参数)。

 

同时tinker指令对应的选项参数也有相应的解释:

技术分享

[ allan allan

Specifies the Allan intercept,which is a parameter of the PLL/FLL clock discipline algorithm,in seconds with default 1500 s.

上面的意思翻译过来是:指定allan截距,这是PLL / FLL时钟纪律算法的参数,以秒为单位,默认为1500秒。

经过查找相关背景资料对时钟纪律算法的解释是如下:

网络时间控制协议的规范和参考是由时钟纪律算法实现的。该算法采用了一个循环机制,该算法有2种模式:第一种phase-lock loop(简称PLL),即阶段锁定循环,第二种frequency-lock loop(简称FLL),即频率锁定循环。二者相互结合,能自适应参数,能对阶段锁定/频率锁定做出回馈。这是一个复杂的算法,可以自动调整最佳性能,同时能最大限度地减少网络开销。

技术分享

[ dispersion dispersion ]

Specifies the dispersion increase rate in parts-per-million(PPM) with default 15 PPM.

翻译过来是:指定每百万分之1的分散增长率,默认是15 PPM(即分散增长率的默认值是每百万分之15) 。

我在apache的kudu官方网站看到apache hadoop团队开发的kudu对ntp.conf的设置的是dispersion 500 和 allan 0 引用他们官方的描述的理由是缩小最大误差:

We’ve performed experiments using the default NTP time source available in a Google Compute Engine data center and were able to obtain a reasonable tight max error bound, usually varying between 12-17 milliseconds.
The following parameters should be adjusted in /etc/ntp.conf to tighten the maximum error

  • server my_server.org iburst minpoll 1 maxpoll 8

  • tinker dispersion 500

  • tinker allan 0

 

技术分享

[ freq freq ]

Specifies the frequency offset in parts-per-million (PPM) with default the value in the frequency file.

翻译过来是:指定在frequency file(即driftfile)中设置的以每百万分之几的默认频率偏差值。

 

技术分享

huffpuff huffpuff ]

Specifies the huff-n‘-puff  filter span,which determines the most recent interval the algorithm will search for a minimum delay.The lower limit is 900 s (15 m),but a more reasonable value is 7200 (2 hours).

翻译过来的大意是:指定了Huff&Puff过滤跨度,这决定了最近的区间算法将搜索最小延迟。下限是900秒(15分钟),但一个更合理的值是7200秒(2小时)。

针对Huff&Puff的解释,我查阅了《NTP Clock Discipline Principles》一书,其中对Huff&Puff的描述是:"Huff&puff algorithm corrects for large outliers and asymmetric delays".意思是Huff&Puff是一种算法,用于纠正离群值和非对称延迟。

 

技术分享

[ panic panic ]

Specifies the panic threshold in seconds with default 1000s.If set to zero,the panic sanity check is disabled and a clock offset of any value will be accepted.

翻译过来的意思是:指定一个panic阈值,单位是秒,默认情况下是1000秒。如果设置为0的话,panic就被禁用了完整性检查并且任意一个时钟偏差值都会被接受。

 

技术分享

[ step step ]

Specifies the step threshold in seconds.The default without this command is 0.128 s. If set to zero, step adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than 0.5 s.

翻译过来是:指定step阈值。默认值0.128s。如果设置为0,step调整将永远不会发生。注意:如果step的阈值被设置为0或者大于0.5s的话内核时间纪律将被禁用。

关于step的解释在《NTP Clock Discipline Principles》一书中只有一句:" ignore if offset exceeds until stepout."

大意是:如果step的阈值到达stepout的阈值时偏差还没有抵消的话就自动忽略。

 

技术分享

[ stepout stepout ]

Specifies the stepout threshold in seconds. The default without this command is 900s. If set to zero, popcorn spikes will  not be suppressed.

翻译过来是:指定stepout的阈值以秒为单位。默认值是900秒。如果设置为0的话, 爆米花峰值将不能被抑制。

关于stepout的解释在《NTP Clock Discipline Principles》一书中也只有一句:"interval within which step spikes are ignored."

大意是:在stepout 设置的这个阈值范围内step的峰值会被忽略。

关于popcorn spikes的解释我只在"The NTP Pool System"中看到相关的片段:"a huff-and-puff algorithm corrects for large outliers and asymmetric delays, and a popcorn spike suppressor clips noise spikes. "

大意是:Huff&Puff算法是为了解决较大的离群值和延迟,以及爆米花峰值,抑制clips噪音峰值。这里的clips我不知道如何翻译比较合适,如果按照字面翻译为剪辑的话比较奇怪,如果有人知道的话还望纠正一下。

以上是ntp.conf中的tinker的参数解释,但是实际验证和原理验证我并没有做,我也看了ntp的算法,相当复杂,况且我的数学水平针对那样的算法简直是让我难堪,到目前我没有看到网上有相关的中文翻译和算法解释。期待有人能这么做。

 

ntp配置中的tinker参数

标签:val   官方   mini   相关   cee   source   选项参数   com   put   

原文地址:http://www.cnblogs.com/sonwnja/p/6758261.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!