|
|
| Author |
Message |
< Erlang ~ erlang:now() differences between nodes and between cores? |
| jwatte |
Posted: Wed Jan 19, 2011 7:27 pm |
|
|
|
User
Joined: 10 Feb 2010
Posts: 34
|
I have a cluster of a few Linux (Ubuntu 10.04) boxes that are synced using ntp. These run Erlang/OTP R13B3. (This is the latest officially available for Ubuntu 10.04 -- I wish they'd go to R14 so the pg2 bug is fixed, but whatever!) The boxes are using Xeon multi-core CPUs.
I am measuring round trips based on calls to erlang:now(), but at times I get negative round-trip times. This seems to be so even if I make sure that the enter and exit timestamps are measured on the same physical node.
Is erlang:now() sensitive to how the CPU implements the time stamp counters? I know that those counters can drift apart on multi-core systems where SpeedStep is active.
Is there some other possible explanation for this observed behavior? (Other than a yet undiscovered bug in my code -- always a possibility) |
|
|
| Back to top |
|
| zajda |
Posted: Sun Jan 23, 2011 3:06 am |
|
|
|
User
Joined: 22 Aug 2009
Posts: 83
|
did you use +c switch?
http://www.erlang.org/doc/man/erl.html
Quote: +c
Disable compensation for sudden changes of system time.
Normally, erlang:now/0 will not immediately reflect sudden changes in the system time, in order to keep timers (including receive-after) working. Instead, the time maintained by erlang:now/0 is slowly adjusted towards the new system time. (Slowly means in one percent adjustments; if the time is off by one minute, the time will be adjusted in 100 minutes.)
When the +c option is given, this slow adjustment will not take place. Instead erlang:now/0 will always reflect the current system time. Note that timers are based on erlang:now/0. If the system time jumps, timers then time out at the wrong time. |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|