[erlang-questions] Schedulers go to sleep even with +sfwi 500 option on R16B03

Vasily Demidenok define.null@REDACTED
Wed Sep 17 21:17:30 CEST 2014

Hello list,

We faced strange performance degradation on the long living node, and found
out that only 3 schedulers out of 12 on a 12 - core machine had been active
for a very long time before the failure. When the load suddenly increased
these 3 schedulers tried to cope with it and hit 100% utilisation very
fast, and even when after 10-15 minutes other schedulers woke up they also
hit 100 utilisation but because of heavy mail boxes (2-3 millions of msgs)
it was not in their power to cope with it. So then OOM came and killed the
node. It was not the load which our application could not cope with, but
there was very little load for a long time before sudden increase, that's
why I guess there schedulers went to sleep.

We have tried approach mentioned in the
 https://gist.github.com/chewbranca/07d9a6eed3da7b490b47 with +sfwi 500
options and it had been working rather well for a long time, but now even
with this option we faced with this situation again, when after some period
only some of schedulers (4-8) out of 12 begin to work (25-40% of

I've checked run_queue and found out that rather often there are peaks
500-2000 on the graph derieved from erlang:statistics(run_queue). So I
guess when the schedulers wake up every 500 ms there should be a chance for
them to steal some work.

I will give an example:

I check:
14> erlang:system_info(schedulers).
15> erlang:system_info(schedulers_online).

So all schedulers are online, but only 8 of them are actually working:

16> erlang:statistics(scheduler_wall_time).

Here we can see that 9-12 schedulers are less busy then others. As I can
see from out metrics they remained in this state for 20-30 hours, which is

I tried this solution:
erlang:system_flag(schedulers_online, 1). timer:sleep(10).
erlang:system_flag(schedulers_online, 12).

It helped and activated all schedulers, but only for several hours. Then
situation repeated.
I wonder if there exist any solution to force schedulers not to go to sleep?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140917/e41920dd/attachment.htm>

More information about the erlang-questions mailing list