What time server do you use?

marthter marthter-FFYn/CNdgSA at public.gmane.org
Fri May 13 18:49:29 UTC 2011


On 11-05-13 12:43 PM, Christopher Browne wrote:
> On Fri, May 13, 2011 at 12:13 PM, Ori Idan<ori-RdxWQVHs3mjDN57Tih+YPw at public.gmane.org>  wrote:
>>>> It uses the time server that it determines is the best reference, and
>>>> disciplines the *kernel's* clock, which is based on your system's
>>>> timer hardware (and ultimately the system's oscillator) as opposed to
>>>> any RTC hardware.
>>>>
>>> And just to be a bit pedantic, ntpd doesn't concurrently use all the
>>> servers it tracks. It keeps detailed statistics on them all, but
>>> selects the best one to use as its sole reference, until one of the
>>> others proves itself better.
>> How does it determines what is a good server?
> By a computation described in RFC 5905.<http://www.ietf.org/rfc/rfc5905.txt>

If you've installed/enabled your distro's NTP package, then

ntpq -p

will tell you which servers your machine is consulting, with a * beside 
the one it is currently considering "best".  E.g.:


      remote           refid      st t when poll reach   delay   offset  
jitter
==============================================================================
-europium.canoni 193.79.237.14    2 u   22  128  377  106.027   10.964   
0.503
+dns1.cmc.ec.gc. 142.3.100.2      2 u   16  128  377   27.601    0.600   
1.368
+dns2.cmc.ec.gc. 142.3.100.2      2 u   22  128  377   27.509    0.325   
1.059
  time.nrc.ca     132.246.11.231   2 u   81  128  377   32.563    
0.233   0.556
*tic.nrc.ca      .PPS.            1 u   13  128  377   32.000    0.449   
1.157
+toc.nrc.ca      .PPS.            1 u   78  128  377   32.575    0.064   
1.868


remote: the server name
refid: which up-stratum server (or timekeeping method - 
radio/GPS/atomic/etc) this server is using
st: stratum (lower means closer to "true time" sources like atomic clocks)
when: how long ago (in seconds) that server was last checked for "the 
current time"
poll: how long (in seconds) between each scheduled check to that server
reach: octal bitmap (0 to 377) of success of last 8 checks to that server
delay: how long (in milliseconds) a check to that server takes (not sure 
if this is an average or most recent; this should be roughly comparable 
to your ping time to it)
offset: how far "wrong" (in milliseconds) your clock is compared to that 
server
jitter: how far wrong the wrongness varies from check to check 
(non-expert's interpretation! - can't tell from the man page if this is 
in milliseconds or microseconds)

It seems tic.nrc.ca and toc.nrc.ca are stratum 1 servers and not really 
published to the public (but not blocked to public access either).  The 
one mentioned on their web site, time.nrc.ca (stratum 2), should 
probably be used instead.

Note, when people are saying the local computer clock gets "disciplined" 
by the algorithm, I think that means it is gradually corrected 
("slewed") by miniscule amounts at a time, and/or that if it sees that 
your clock is routinely 2 ms slow per day, it routinely corrects for that.

If it sees an offset of -95 ms to your next "best" server, you don't 
just want it to instantly correct your clock by -95 ms because after the 
next check of that server (due to network delays, jitter, and your own 
computer clock's inaccuracies) you could be detecting a different offset 
of +51 ms.  If your machine is scheduling any processes so precisely, 
you could be missing process start times, or going too long between two 
processes.  In between checks, you are just on an island running with 
your own computer's clock, which has some oscillator with errors of its 
own, it could have temperature-based variability, voltage-based 
variability, karma-based variability.  And if the upstream guy was doing 
lurching corrections, it would throw off calculations of how far off 
everyone else thought their own clock was between checks.  The 
algorithms are aimed at getting things to gradually converge to "the one 
true time" with as much precision and accuracy as their hardware and 
interconnections will allow.

At the (potential) levels of precision and accuracy that this provides, 
you have to remember that every measurement has some sort of error in 
it, so every "answer" and output (and input to the next iteration) has 
some uncertainty.

If you just want "the second hand" on your computer's clock to be about 
right, to start your mythtv shows on time, or your log file entries to 
be correlate-able between servers ("I got an e-mail bounce at 5:43:21 
today, what was the web server sending at that time?"), and similar 
everyday purposes, I'd say you only need to configure one server and 
don't need to care about what stratum it is; your distro's defaults 
(after you just turn on NTP) are probably just fine.

Cheers.

Martin

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list