1

I have 2 servers on a LAN that I want to precisely synchronize. the goal is to have a time difference < 500 microseconds, constant, with no drift (from what I've found on the web, this is achievable accuracy).

those two servers must also have "correct" time but the accuracy is less important (within 1 second of the "real" time is acceptable). the "official" time servers are only accessible through a WAN (so latency - accuracy is higher).

what's the best way to proceed ? so far, I've set up server A as a NTP client to official time servers, and server B as a NTP client to server A. NTP have been running for more than a day, drift file are updated regularly, however I can still see that time is drifting between server A & B (around 1ms every 55 seconds - very regular drift).

any idea / comment ?

thanks

2
  • Peer them as marcoc points out below.
    – Chris S
    Jan 28, 2011 at 14:56
  • tried to Peer, but no impact: still 1ms every 57 seconds (constant).
    – Bastien
    Feb 1, 2011 at 2:48

5 Answers 5

2

I have 2 "internal" servers. On each one I have a configuration similar to this one

peer <otherserver>

server <reliable1.external.source>
server <reliable2.external.source>

restrict 127.0.0.1
restrict <otherserver>
restrict <reliable1.external.source> kod notrap nomodify
restrict <reliable2.external.source> kod notrap nomodify
restrict <ntpclients> nomodify notrap nopeer
restrict default ignore

driftfile /var/lib/ntp/drift

On Solaris 10 I have enabled svcadm enable ntp4.

BTW I would consider buying a GPS+NTPd clock...

2
  • +1 Peer the servers to keep them synchronized against each other.
    – Chris S
    Jan 28, 2011 at 14:56
  • I setup a similar configuration, synchronizing both servers to reliable "distant" clocks, and Peered the two servers together, that didn't change anything: I still have one clock drifting 1ms every 57 seconds. alternatively, as this drift if constant (and strangely not corrected by NTP), is there a way to manually correct it ? can I manually add a value to the drift file ? or any other solution ?
    – Bastien
    Feb 1, 2011 at 2:46
1

Personally for two servers I would just set them both up to use NTP from the internet clocks. That way if there is any irregular skew of server A happening it won't upset server B's NTP process.

In situation where I had a lot of machines, I would have three systems that were both highly reliable and ideally had better-than-average clocks and have them set to use NTP from the internet clocks, then have the rest of the systems use NTP to them.

(No good personal aside: Sun (ultra and regular) Sparc systems have clocks which range from horrible (Netra X1s) to excellent (the SS20s had very nice clocks). Other Suns could range widely in clock quality within the same system model. When I say horrible, I mean "NTP would give up trying to keep it in sync within a day" horrible. So you are kind of at the mercy of the quality of the systems' clocks.)

1
  • server A (that is syncing from internet clock) shows a delay (as in ping delay) of 180ms. I'm afraid that might be too much to guarantee < 500 microsec difference between 2 servers syncing to internet clock, but I might be wrong, and will test it.
    – Bastien
    Jan 27, 2011 at 4:54
1

I think if the external delay is relatively constant then the ntp protocol can get you quite accurate synchronization. I'd be more concerned if your external delay fluctuated, then ntp will have trouble achieving maximum accuracy.

Here's a very technical pdf that says you can get accuracy down to a few nanoseconds with the right configurations.

If you really need that sort of accuracy, have you thought about installing some sort of ntp appliance and syncing to that? That way you would eliminate the variable of external delay.

1
  • interestingly enough, the paper describes one configuration that could correspond to what I'm looking for, however it says "with a polling interval of 16s" (or 64s), and I can't find any way to FORCE ntpd to poll at a fixed interval. any idea ? the polling interval is set automatically by the system, mine is at 1024 after a few hours running. no idea how to force it back to 16s or 64s, that would probably help me...
    – Bastien
    Jan 27, 2011 at 8:40
0

Did you try tinker minpoll to change the interval back?

0

Consider investing in a dedicated ntp server and sync those servers to the ntp hardware. Besides getting the right time from a source like GPS they are also optimized to minimize jitter by their choice in hardware and build. As noted in one answer some types of hardware you can install ntpd on will still cause lots of jitter.

Dedicated NTP hardware is not cheap, but it can save you weeks of finding the right system to use as a timekeeper.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .