[erlang-questions] inaccurate interval timer

Ian hobson42@REDACTED
Thu Nov 15 16:56:01 CET 2012


On 15/11/2012 03:12, Mark Geib wrote:
> I am using timer:send_interval(..) to generate recurring messages that drive the sending of UDP packets at a given rate. However, using a network analyzer I am observing that the network datagrams are being sent at a rate greater than the intended rate. Log messages with timestamps indicate the erlang code is sending the datagrams at the proper time. So the question is whether the erlang VM could possibly have a clock that is "tic-ing" at a incorrect frequency, or this an issue with the underlying OS, linux in this case. The interval of the timer is set to 25ms, I am observing times of 23.7-24.5ms. Also, this is only happening on a single machine, testing on four other machines confirms proper rates are being generated.
>
>
Hi Mark,

This would happen if the hardware clock is used for one purpose while 
the software clock is used for the other, and they are running at 
different speeds.

If ntp is re-syncing them regularly you won't get the clocks getting way 
out of step.

I would check that the rogue machine is not over-clocked, has the 
correct multiplier set in the BIOS. Also disable ntp and see if the 
clocks get out of step.  1 /25 would amount to about an hour a day.

Regards

Ian






More information about the erlang-questions mailing list