[erlang-questions] start_timer and timer fired lag

Alexander Petrovsky askjuise@REDACTED
Mon Mar 26 18:01:38 CEST 2018


2018-03-26 18:35 GMT+03:00 Jesper Louis Andersen <
jesper.louis.andersen@REDACTED>:

> Pure guess: You are being CPU throttled in order to save power, or the
> virtual machine is throttling you.
>
> Enable the erlang system monitor and start looking for long schedules.
> These are usually an indication that you are being throttled by something.
> Either a bad NIF which isn't dirty-scheduling the right way, or by the
> underlying system stalling you. Perhaps because your timer is on a separate
> core and async-fires to another core. In general, timers can be stalled by
> the system, so you have no guarantee that they will fire close after their
> trigger point. But if you have timers which are periodically behind
> schedule, I'd look into the virtual setup.
>

 Hm, it's occur from time to time, not for every test run, so looks lile
you are right about "being throttled by something".

One simple test is to run outside virtualization to make sure it isn't
> causing the problems.
>

Outside VM all tests passed, so I've just want to undestand why and where
VM causing problems.


> But I'd enable the system monitor anyway since it is a good way to detect
> unruly underlying hardware/virtualization layers.
>

When I run system_monitor, which metric should I use? Only  *long_schedule?*


>
> On Mon, Mar 26, 2018 at 4:19 PM Alexander Petrovsky <askjuise@REDACTED>
> wrote:
>
>> Hi!
>>
>> I'm usgin nksip library for working with sip protocol and in my virtual
>> machine (windows -> virtualbox -> ubuntu) I'm observer very strange
>> behaviour with erlang:start_timer [1]. Some time in common test, the timer
>> fires with lacency with hundred milliseconds.
>>
>> I've check, there is no messages in queue, msacc says there is no problem
>> with schedulers and whole system is idle, erlang:monitor(time_offset,
>> clock_service) show that time in virtual machine flows monotonically.
>>
>> I wonder, how can I find out why erlang behaves strange sometimes?
>>
>> Erlang version is:
>>
>> $ erl
>>> Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10]
>>> [async-threads:10] [kernel-poll:false]
>>> Eshell V9.2  (abort with ^G)
>>
>>
>>
>> [1] https://github.com/NetComposer/nksip/blob/
>> d27e896bc959ebcf6e238ecc45a1ee3d76bc7399/src/nksip_call_lib.erl#L309
>>
>> --
>> Петровский Александр / Alexander Petrovsky,
>>
>> Skype: askjuise
>> Phone: +7 931 9877991 <+7%20931%20987-79-91>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>


-- 
Петровский Александр / Alexander Petrovsky,

Skype: askjuise
Phone: +7 931 9877991
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180326/221d026f/attachment.htm>


More information about the erlang-questions mailing list