I am deploying a application written on erlang built using rebar3. When I run it, it is using single core of the CPU. What should I do to make it use all the cores? Thanks
Asked
Active
Viewed 96 times
-2
-
As Pichi stated, you would need to provide something more if you like to move forward with this one. – x80486 May 22 '18 at 20:01
2 Answers
2
- Because all the work is in one process?
- Because work in processes is interlocked so each time only one process can work?
- Because it is ill-configured?
You didn't provide any meaningful and relevant information to answer.

Hynek -Pichi- Vychodil
- 26,174
- 5
- 52
- 73
1
According to the answers to this question and the Erlang reference manual, starting the runtime with -smp enabled
will cause the runtime to create multiple OS schedulers to dispatch tasks to different CPUs. You could verify this when you run erl
runtime and look at [smp:8:8]
(This means I'm running with 8 schedulers).
However, normally Erlang manages this under the hood for you by creating an OS thread (scheduler) for each core on your machine which tasks can be assigned to evenly.
One more thing you might want to look into is if your code is written in a concurrent way or mostly running sequentially in which case only a single core is needed anyway.

Pandemonium
- 7,724
- 3
- 32
- 51