ntp配置中的tinker参数

摘要:
今天就ntp的tinker来做专项学习。此处的tinker指的是ntp.conf配置文件中的一个配置指令名。它还有相关的配置选项经过查看官方文档其中对ntp.conf中的tinker是如下描述的:官方文档:http://doc.ntp.org/4.2.6/miscopt.html意思是这个tinker指令是改变由时钟纪律算法使用的某些系统变量,这些变量的默认值已经针对广泛的网络速度和可靠性期望进行了精心优化,很少有必要去改变它的默认值,除非有的人忍不住非要去转动旋钮。

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

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

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

ntp配置中的tinker参数第1张

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

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

ntp配置中的tinker参数第2张

[ allanallan ]

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),即频率锁定循环。二者相互结合,能自适应参数,能对阶段锁定/频率锁定做出回馈。这是一个复杂的算法,可以自动调整最佳性能,同时能最大限度地减少网络开销。

ntp配置中的tinker参数第3张

[ 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

ntp配置中的tinker参数第4张

[ freq freq ]

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

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

ntp配置中的tinker参数第5张

[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是一种算法,用于纠正离群值和非对称延迟。

ntp配置中的tinker参数第6张

[ 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就被禁用了完整性检查并且任意一个时钟偏差值都会被接受。

ntp配置中的tinker参数第7张

[ 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的阈值时偏差还没有抵消的话就自动忽略。

ntp配置中的tinker参数第8张

[ 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参数》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇接口测试-自动化-Java-思路eclipse导入maven项目有红叉及pom.xml出错的问题的解决下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

运用CDH5.15离线搭建简易版集群

                                 运用CDH5.15离线搭建简易版集群 关于CDH和Cloudera CDH(Cloudera的发行版,包括Apache Hadoop),是Hadoop众多分支中的一种,由Cloudera维护,基于稳定版本的Apache Hadoop构建,并集成了很多补丁,可直接用于生产环境.Cloudera...

centos7配置ntp服务器和客户端同步

环境centos7.6 服务端:ip:172.21.210.27 1、安装ntp、禁用chronyd时间同步服务 yum -y install ntp   #安装ntp服务 timedatectl set-ntp 0 2、配置ntp服务器 vi /etc/ntp.conf restrict default nomodify                 ...

通过NTP协议进行时间同步

最近发现手机的时间不是很准了,便到网上下了一个同步时间的小程序,简单了看了一下它的原理,是通过NTP协议来实现校时的,就顺便学习了一下NTP协议,用C#写了个简单的实现。 NTP(Network Time Protocol,网络时间协议)是由RFC 1305定义的时间同步协议,用来在分布式时间服务器和客户端之间进行时间同步。 NTP工作原理 NTP的基本工...

windows ntp安装及调试

Setting up NTP on Windows It's very helpful that Meinberg have provided an installer for the highly-respected and high-accurate NTP software for Windows users - my thanks to them....

阿里云内网和公网NTP服务器和其他互联网基础服务时间同步服务器

阿里云为云服务器ECS提供了内网NTP服务器,对于阿里云以外的设备,阿里云同时提供了 公网NTP服务器,供互联网上的设备使用。 内网和公网NTP服务器 以下为阿里云提供的内网和公网NTP服务器列表。 经典网络 VPC网络 公网 ntp1.cloud.aliyuncs.com ntp7.cloud.aliyuncs.com ntp1.aliyun...

阿里最新热修复Sophix与QQ超级补丁和Tinker的实现与总结

2015年以来,Android开发领域里对热修复技术的讨论和分享越来越多,同时也出现了一些不同的解决方案,如QQ空间补丁方案、阿里AndFix以及微信Tinker(Bugly sdk也集成Tikner热更新)和阿里最新出品Sophix.它们在原理各有不同,适用场景各异,到底采用哪种方案,是开发者比较头疼的问题。下面是这几种技术方案介绍。 技术背景 一...