[ntp:questions] Order of servers in ntp.conf

unruh unruh at invalid.ca
Wed Aug 14 19:56:03 UTC 2013


On 2013-08-14, Nils Brubaker <ncb at us.ibm.com> wrote:
> Thank you, unruh at invalid.ca, for your response to my question.
>
> Couple follow-up questions.  My ntp.conf running on Linux has 4 servers 
> defined:
>
> server 0.rhel.pool.ntp.org
> server 1.rhel.pool.ntp.org
> server 2.rhel.pool.ntp.org
>
> These are public servers from the NTP pool project.  In my 
> /var/log/diag-log file, I see messages indicating that my ntpd is synching 
> with individual servers, for example:
>
> Aug  7 09:53:58 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
> stratum 2
> Aug  7 10:04:52 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
> stratum 2
> Aug  7 10:39:05 yellowstone ntpd[3272]: synchronized to 69.50.219.51, 
> stratum 2
> Aug  7 11:28:17 yellowstone ntpd[3272]: synchronized to 184.82.112.110, 
> stratum 2
> Aug  7 12:47:06 yellowstone ntpd[3272]: synchronized to 128.10.19.24, 
> stratum 1
> ...
> Aug  8 11:37:43 yellowstone ntpd[3254]: synchronized to 50.116.55.65, 
> stratum 2
> Aug  8 12:18:46 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
> stratum 2
> Aug  8 13:01:27 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
> stratum 2
> Aug  8 15:01:00 yellowstone ntpd[3254]: synchronized to 50.116.55.161, 
> stratum 2
> Aug  8 16:09:20 yellowstone ntpd[3254]: synchronized to 38.101.77.21, 
> stratum 2
>
> These log messages suggest that ntpd is synchronizing with one and only 
> one NTP server.  Is that the correct interpretation?  Is this single 
> server selected for synchronization only after performing all the 
> calculations described below?

As I understand it, once it has done all of the calculations, it picks
one of the servers in the accepted bunch of servers and uses it as a
proxy for all of them. Ie, the above is shorthand for 
synchronized to a pool of servers which includes 38.101.77.21


>
> Also, I see long time periods in the diag-log where there is no 
> synchronization message.   What does that signify?  No agreement between 

No change.

> the servers on the correct time?  No need to adjust system clock because 
> it is already in sync?

Neither. You can look at the loopstats file to see what is actually
happening. 
Remember also that once  ntpd drops to poll interval 10, that means 1024
seconds between polls (that is about 20 min) and it then chooses 1 of
about 8 of those polls to actually use. So, the time between effective
polls is about 3 hours. Nothing changes in that three hours since there
is no new data. 

I am sure that someone will correct me if I have some of the details of
the selection algorithm wrong.



>
> Thanks,
>  Nils Brubaker
>
>
> On 2013-08-13, Nils Brubaker <ncb at us.ibm.com> wrote:
>> For ntpd 4.2.4p6 running on Linux, is there any significance to the 
> order 
>> of servers in the ntp.conf file?  Will ntpd synchronize with the first 
>> available/good time server in the list?
>
> No, no.
> ntp gets the data from all the servers. It then looks at the times it
> gets from each server, and groups them into "classes" according to its
> estimate of the max time error from the server-- ie whether the error
> intervals overlap or not. It then looks for the largest group of servers
> all of whose error intervals overlap and uses the average of those times
> as the time to send on the the ntp engine. The others are "false
> tickers". It estimates the error by looking at the round trip time and
> the other machine's estimate of its own max error.



More information about the questions mailing list