[erlang-questions] Timers for hibernated processes

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Tue Nov 22 18:10:39 CET 2011

On 2011-11-22 15:20, Zvi wrote:
> I suspect, that timers are not implemented in scalable way in the BEAM
> or there are any soft/hard limits (like for number of processes/ports/
> ets/etc.)

Erlang/OTP uses a timer wheel internally with 64k entries. So if you 
have 300k processes, there will be around 300/64 = 4-5 processes per 
slot to check, assuming that your timers distribute evenly. If they do 
not distribute evenly, which they probably don't, then you have a few 
slots with lots of timers in them and many slots with 0 timers in them.

In *principle* this kind of structure should be extremely scalable. I 
would try reconstructing the problem without any kind of other subsystem 
(TCP, Cowboy, ...) first, so you have a smaller failing test case. Then 
you can probably instrument Erlang/OTP by inspecting the Timer wheel. 
This will probably tell us a lot more about the limitations of the timer 
wheel structure in this case.

Jesper Louis Andersen
   Erlang Solutions, Copenhagen, DK

More information about the erlang-questions mailing list