We are running Erlang 14B03 on the following Host:
HP Proliant G6 Server, has 2 Intel processors, each processor has 2.4GHz speed, 8MB Cache, each processor has 4 cores. The Server has 20 GB RAM.
How would we apply the -smp
emulator option to make full use of Hyper Threading capability of the server. What performance benefits would we achieve with a scheduler on each Core of each processor (making them 8 schedulers in total) ?
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).