<div dir="ltr">Hello,<div><br></div><div>Would you mind sending me the "perf script" output from your profiling runs so that I can have a closer look?</div><div><br></div><div>For the record, CPU utilization is a terrible way to measure load on a system, especially if you are running on much less than full throttle. Because of how expensive it is to go to sleep, all the threads in the Erlang VM will spin and consume CPU when it is out of work and if you are running at 25% CPU then you are running out of work very often which will cause more spinning which will increase CPU while not decreasing the amount of work the system can do.<br></div><div><br></div><div>One way to work around that is to compact the load of the schedulers better, so that instead of running at 25% on each scheduler, you run on 100% on one and 0% on the other three. The default config attempts to do this, but it is a trade off in how fast you want to be able to react to an increase in load and how much CPU you want to spend spinning, so it is not as aggressive as it could be. You can change how aggressive it is by setting the scheduler wakeup threshold so a higher value, i.e. "+swt very_high". This may reduce some of the time that you see in scheduler_wait when profiling.</div><div><br></div><div>Another way to effect the wait time is by changing the scheduler busy wait threshold so that when the schedulers run out of work they will spin more or less, i.e. "+sbwt short" or "+sbwt long". You will have to experiment and see which is best for this specific benchmark.</div><div><br></div><div>Fun fact, in virtualized environments it is crazy crazy crazy expensive to go to sleep. By compacting load we have seen systems get a reduction of up to 10% CPU usage without changing anything but where the work is scheduled.</div><div><br></div><div>Lukas</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 9:49 PM, Ameretat Reith <span dir="ltr"><<a href="mailto:ameretat.reith@gmail.com" target="_blank">ameretat.reith@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 9 Feb 2016 16:19:07 +0100<br>
Jesper Louis Andersen <<a href="mailto:jesper.louis.andersen@gmail.com">jesper.louis.andersen@gmail.com</a>> wrote:<br>
<br>
> Where is that time spent in the Erlang VM or in the Kernel? You are<br>
> potentially on a wakeup schedule of 81 wakeups per millisecond to<br>
> handle packets. Which suggests you need to understand where your CPU<br>
> time is spent in the system in order to tune it for lower CPU usage.<br>
<br>
</span>In more powerful machines that can handle 1Gbit/s with 50% CPU<br>
utilization, It's VM's scheduler_wait consuming about 30% of CPU usage.<br>
(xeon-e3 attachment) suggesting system can get more input.  In<br>
overloaded and less powerful machines, VM task management functions get<br>
more resources and time spent in kernel is less than 20%. (corei3<br>
attachment)<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>