By default Erlang should start up 8 schedulers for you if it is compiled with SMP. You can see this in the startup headers:
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:2] [async-threads:0]
[hipe] [kernel-poll:false] ^^^^^^^^^
This is equivalent to giving -smp auto
as a flag. -smp enable
would just force SMP mode, even on a single core system (which usually decreases performance somewhat).
Using the +S
flag you can control how many schedulers should be created (and how many should be online). For example:
$ erl +S16:16
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:16:16] [rq:16]
[async-threads:0] [hipe] [kernel-poll:false]
Going even further, you can use the +sct
flag to exactly define which schedulers should reside on which exact core. See the erlang manual for a description of that flag, since it is quite complex.
Note however that Erlang should already start one scheduler per core (even if they are hyper threads) if the OS exposes them. Make sure that you're not running on a dual quad core system with hyper threads already visible (making it a total of 8 virtual cores).