[ntp:questions] Clock Setting Test Results (Was: Re: ntpdate removal is coming)

Steve Kostecke kostecke at ntp.org
Sat Dec 10 18:01:30 UTC 2011


On 2011-12-10, Harlan Stenn <stenn at ntp.org> wrote:

> It would be instructive to test and document [various ways of
> initially setting the clock] more thoroughly.

Here are the results of a quick test of various ways of setting the
clock. These tests were performed on a warm, stable, system which
had been up for over 8 days and has a "good" drift file. It may be
instructive to perform these tests on a cold system which does not have
a drift file.

The elapsed time for each of these methods was determined by reading
/proc/uptime before and after each run. This file contains the length of
time since the system was booted, as well as the amount of time since
then that the system has been idle. Both are given as floating-point
values, in seconds.

The same remote time server was used for all of these tests (except for
ntpd with the pool directive.

Results (all times are in seconds):

               Start      Stop   Elapsed

sntp       775344.09 775349.83      5.74

ntpdate    775360.18 775372.03     11.85

ntpd w/ single remote time server       
       -gq 775391.78 775403.91     12.13                    
  ntp-wait 775965.69 775983.86     18.17                    

ntpd w/ pool directive        
       -gq 775488.60 775565.72     77.12                    

Test Details:

stasis:~# cat /proc/uptime; sntp -Ss ntp-2.cso.uiuc.edu; cat /proc/uptime
775344.09 25922.86
sntp 4.2.7p238 at 1.2483-o Sat Dec 10 02:25:08 UTC 2011 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod
2011-12-10 11:21:29.607648 (+0600) +0.002744 +/- 0.010818 ntp-2.cso.uiuc.edu
2620:0:e00:4011::2 s2
775349.83 25922.92

stasis:~# cat /proc/uptime; ntpdate ntp-2.cso.uiuc.edu; cat /proc/uptime
775360.18 25922.93
10 Dec 11:21:51 ntpdate[32580]: adjust time server 130.126.24.44 offset
-0.001922 sec
775372.03 25923.73

# Using a single server
stasis:~# cat /proc/uptime; ntpd -c /tmp/ntp.boot -gq; cat /proc/uptime
775391.78 25923.80
ntpd: time slew +0.002419s
775403.91 25923.83

# Using pool configuration
stasis:~# cat /proc/uptime; ntpd -gq; cat /proc/uptime
775488.60 25926.80
ntpd: time slew +0.000463s
775565.72 25927.90

# Using a single server + ntp-wait
stasis:~# cat /proc/uptime; /etc/init.d/ntp-dev start; ntp-wait -v; cat
/proc/uptime 
775965.69 25930.40
Starting NTP server: ntpd.
Waiting for ntpd to synchronize... OK!
775983.86 25930.41

-- 
Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/



More information about the questions mailing list