[erlang-questions] How to setup Erlang to run on physical cores

Tan Duong <>
Mon Oct 17 17:06:20 CEST 2016


Hi Daniel,

Thank you for answering me.
I have tried as well on a Ubuntu Machine. And the scheduler bindings are as
you described.
I haven't run the programs though. I am planing to watch the CPU
untilization via htop (also hwloc-ls) and possibly will let you know.

On the other hand, the same command are not available for Mac OSx. There I
had to change + to - prefixing sbt and SP.
when I tried, it just return no information

erl -sbt ts -SP 50:50

Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10]
[hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)

1> erlang:system_info(cpu_topology).

undefined

2> erlang:system_info(scheduler_bindings).

{unbound,unbound,unbound,unbound}

Anyway, this is just a minor. I have heard that Erlang scheduler can not be
bound to CPU on Mac.

Best,



On Mon, Oct 17, 2016 at 4:55 PM, Dániel Szoboszlay <>
wrote:

> Yes, I don't use the hyperthreaded CPUs. But that was the point of the
> original question: how to disable hyperthreading for Erlang?
> If you want better control over which cores to use, you need to use +sct,
> I agree.
>
> On Mon, 17 Oct 2016 at 16:38 Vans S <> wrote:
>
>> > I have 2 schedulers bound to logical cores 0 & 1, exactly as intended.
>>
>> Now bind them to cpus 1 and 3.
>>
>> You got bound to 0 and 1 by default.  Also erlang is not using the
>> hyperthreaded cpus you have available.
>>
>>
>> On Monday, October 17, 2016 10:33 AM, Dániel Szoboszlay <
>> > wrote:
>>
>>
>> Well, I tested, and it does work as long as you have 2 thread/core:
>>
>> erl +sbt ts +SP 50:50
>> Erlang/OTP 17 Klarna-g48fc1a0 [erts-6.4.1.5] [source-48fc1a0] [64-bit]
>> [smp:2:2] [async-threads:10] [kernel-poll:false]
>>
>> Eshell V6.4.1.5  (abort with ^G)
>> 1> erlang:system_info(cpu_topology).
>> [{processor,[{core,[{thread,{logical,0}},
>>                     {thread,{logical,2}}]},
>>              {core,[{thread,{logical,1}},{thread,{logical,3}}]}]}]
>> 2> erlang:system_info(scheduler_bindings).
>> {0,1}
>>
>> I have 2 schedulers bound to logical cores 0 & 1, exactly as intended.
>>
>> On Mon, 17 Oct 2016 at 16:05 Vans S <> wrote:
>>
>> > You may both want to look at the +sct option for the erl executable:
>> > http://erlang.org/doc/man/erl.html#+sct
>>
>> This is the right answer.
>>
>>
>> > erl +sbt ts +SP 50:50
>>
>> This wont bind to the specific system cores.  It will use all cores the
>> OS allows.
>>
>>
>> On Monday, October 17, 2016 9:51 AM, Fred Hebert <>
>> wrote:
>>
>>
>> On 10/17, Vans S wrote:
>> >I am interested in this too. Only way I know of so far is to use taskset
>> or equivalent.  Ideally Erlang should bind each scheduler to each single
>> cpu as speced by the topology.
>> >
>> >    On Monday, October 17, 2016 9:35 AM, Tan Duong <>
>> wrote:
>> >
>> >
>> > Hi everybody,
>> >I recently get to experiment an Erlang program.My machine is a multicore
>> CPUs system, which contains some physical cores (say n), each cores
>> features hyper threads (so the maximum CPU threads are 2*n)However, I just
>> want to experiment the program on physical cores only (n cores), not with
>> hyperthreading.is there any mechanism to do so?
>> >Best Regards,Tan
>>
>> You may both want to look at the +sct option for the erl executable:
>> http://erlang.org/doc/man/erl.html#+sct
>>
>>
>> Regards,
>>
>> Fred.
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161017/dce662a5/attachment-0001.html>


More information about the erlang-questions mailing list