[erlang-questions] erlang:send_after/3 questions
Sat Sep 22 10:06:54 CEST 2012
In my experience, using excessive timers once bit me hard due to lock
contention on global timers lock in Erts. Roughly it was about 3-5 timers
created/expired for each of around 200k-500k processes at roughly the same
moment (a big broadcast to all processes). Fortunately lcnt showed the
problem which was slowing down the broadcast tenfold - lock conflicts was
at 95% level on timers lock.
On Sep 22, 2012 8:07 AM, "Rapsey" <rapsey@REDACTED> wrote:
>> 3. Is spawning a lot of send_after's or timers a dangerous idea? In case
>> of using timer module, we'll just lose some started timers due to port
>> restart. But something tells me that crash of erlang internal timers is a
>> somewhat more dangerous thing that might even crash the VM.
>> How much is a lot of send_afters? My server runs a lot of timers, but
> very rarely in more than one per process. But there can easily be thousands
> of timers running in different processes.
> I would advise against using timer module. Using the timer module in a few
> places turned out to be a big mistake. It sometimes just stops working
> completely. It may be a mistake on my part, but erlang:send_after generally
> does everything you need and is completely reliable.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions