Force ntpd to make changes in smaller steps

Posted by David Wolever on Server Fault See other posts from Server Fault or by David Wolever
Published on 2012-11-15T22:51:16Z Indexed on 2012/11/15 23:04 UTC
Read the original article Hit count: 219

Filed under:
|

The NTP documentation says:

Under ordinariy conditions, ntpd adjusts the clock in small steps so that the timescale is effectively continuous and without discontinuities - http://doc.ntp.org/4.1.0/ntpd.htm

However, this is not at all what I have noticed in practice. If I manually change the system time backwards or forwards 5 or 10 seconds then start ntpd, I notice that it adjusts the clock in one shot.

For example, with this code:

#!/usr/bin/env python
import time
last = time.time()
while True:
    time.sleep(1)
    print time.time() - last
    last = time.time()

When I first change the time, I'll notice something like:

1.00194311142
8.29711604118
1.0010509491

Then when I start NTPd, I'll see something like:

1.00194311142
-8.117301941
1.0010509491

Is there any way to force ntpd to make the adjustments in smaller steps?

© Server Fault or respective owner

Related posts about linux

Related posts about ntpd