[erlang-questions] lowering jitter: best practices?
Tue May 26 23:03:41 CEST 2015
Innovative thinking, Jesper! But in this case, in this testbed, the fsms
aren't getting any messages other than those which they are delivering to
themselves. Which adds to the intrigue.
I took your suggestion and tried using gen_fsm:start_timer/2.
Interestingly it slightly increased the jitter variance and the negative
jitter issue is still present. It's possible that my, ah,
rapidly-and-pragmatically-built testbed suffers from some flaw, but I'm not
Here's my code:
Here's sample output on this small but moderately modern non-cloud osx
waiting for 1000 FSMs, tickrate 40
note that the max is 50ms of jitter; the min is negative 184 us jitter, and
the median jitter is about 1ms, which correlates well with my beliefs about
scheduler wakeup timers...
On Tue, May 26, 2015 at 12:09 PM, Jesper Louis Andersen <
> On Tue, May 26, 2015 at 8:52 PM, Felix Gallo <felixgallo@REDACTED> wrote:
> This explains why you sometimes get less than 30ms sleep times. If an
> event reaches the process before Timeout, then the timeout is not
> triggered. Also, it may explain the jitter you are seeing, because an early
> event will reset the timeout. Try using gen_fsm:start_timer/2 or
> If the problem persists, check lcnt. If you are locked on the timer wheel,
> then consider release 18 :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions