time syncronization in erlang cluster

Primanathan Reddy [ MTN - Innovation Centre ] <>
Fri Jan 9 09:51:07 CET 2004


Hi 

Thanks for the helpful info on now().

I'm going to try NTP.

Will keep the list updated on how it turns out.

>:)
Reddy.P[Prima]


-----Original Message-----
From: Ulf Wiger [mailto:]
Sent: Thursday, 08 January 2004 8:09 PM
To: WILLIAMS Dominic; Erlang (E-mail)
Subject: Re: time syncronization in erlang cluster


On Thu, 8 Jan 2004 14:19:46 +0100, WILLIAMS Dominic 
<> wrote:

> Hi Pete,
>
>> What is the platform? If you're using a flavour of UNIX, you
>> may wish to use NTP (network time protocol RFC 1305) and
>> bypass Erlang for synchronisation. I imagine there are NTP
>> clients and servers implemented for most platforms.
>
> Indeed, including Windows (just don't use Microsoft's built-in
> version, which is simplified, if you want the features I
> described in my previous post).
>
> However, this doesn't work, at least for Erlang systems running
> uninterruptedly, if the Erlang runtime only gets the system time
> at start-up...

This is how erlang:now() works.

At startup, it samples the system time, and then it starts running
loosely coupled to the system time. That is, it periodically samples
the system time and makes small adjustments (+/- 1%) so that it
will eventually converge with the actual system time ("eventually"
may be an arbitrarily long time, depending on what happens to the
system time.)

So to answer your initial question: you cannot synchronize erlang:now(),
since it is designed to adjust itself to e.g. NTP, while preserving the
property that subsequent calls to erlang:now() should always return
unique values in increasing order.

/Uffe
-- 
Ulf Wiger



NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/email_disclaimer.asp



More information about the erlang-questions mailing list