ntp inquiry
David Thornton
david-FkEgs2FKm2NvBvnq28/GKQ at public.gmane.org
Sat Jun 4 04:56:07 UTC 2005
Christopher Browne wrote:
>On 6/3/05, JM <jerome-mhXWc29+iYPyG1zEObXtfA at public.gmane.org> wrote:
>
>
>>hi all,
>>
>> i have a ntp server that syncs with singapore and in the philippines.. just
>>
>>recently i have a cron job the that executes twice... im wondering if
>>syncing
>>on 2 diff countries is a bad idea.. how does ntp poll for time?
>>
>>
>
>If you are doing this via a cron job, then I presume that what you
>have is thus (or otherwise equivalent):
>
>for server in something.sg something.ph; do
> ntpdate $server
>done
>
>If you do something like that, with 2 runs of ntpdate, then YOU are
>the one polling, and you are doing so twice. You adjust the time
>first to the "Singapore" time, then to the "Filipino" time. The sync
>against Singapore is actually irrelevant because it is immediately
>overridden by the second time sync.
>
>You would get better results with your polling if you instead did...
>
># Build up list of servers in $SVLIST
>SVLIST=""
>for server in something.sg something.ph; do
> SVLIST="$SVLIST $server"
>done
>ntpdate $SVLIST
>
>That would cause the ntpdate program to consider both NTP servers at
>once; it would attempt to take the best time sync based on evaluating
>them all.
>
>In all the above cases, it is YOU that do all the polling. ntpdate
>doesn't poll; it just requests time information once.
>
>Far and away better is to put the two servers into /etc/ntp.conf...
>
> server something.sg
> server something.ph
>
>And start up ntpd, which will NOT run as a cron job, but which will
>rather stay running all the time. That would periodically (once time
>seems stable, probably every five minutes or so) poll each of the
>servers.
>
>
I have to agree 100% with the idea of running ntpd all the time.
Then ntpd can get a feel for your network latency and the clock jitters
otherwise.
When I say get a feel.. what I mean is : it uses high math to account
for tcp/ip over many hops. I.e. the lack of reliability.
Then later (after a couple of hours) you can use "ntpq -c pe" and "ntpq
-c as" to get a feel for the quality of each ntp server ( and your own
local clock)
At allstream we use it in our golden master and it's great.. I never
have to worry about time .. well nearly never.
I use my local caching name servers as ntp servers (stratum 3) and point
all my client's servers at the caching name servers for ntp.
david
--
Let one walk alone,
commiting no sin with few wishes,
like an elephant in the forest.
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list