[erlang-questions] SMP performance with hackbench

Zoltan Lajos Kis kiszl@REDACTED
Wed Aug 19 08:35:35 CEST 2009


Hi,

First check if the cpu topology is properly identified: 
erlang:system_info(cpu_topology). If not, set it manually: 
erlang:system_flag(cpu_topology, Topo). (see slide* 27 for Topo).
Then bind the schedulers to cpu cores: 
erlang:system_flag(scheduler_bind_type,default_bind). Check that the 
binding succeeded: erlang:system_info(scheduler_bindings).
Try the SMP test again with these settings, and please tell us the new 
results.

*see slides 22-28 in Kenneth's talk on multicore:
http://www.erlang-factory.com/upload/presentations/105/KennethLundin-ErlangFactory2009London-AboutErlangOTPandMulti-coreperformanceinparticular.pdf

Regards,
Zoltan.

Jiang Wei wrote:
> Hi, list
>      I write hackbench in erlang to test the performance, which is 
> originally a benchmark for linux scheduler.
>      (Hackbench contains several groups; each groups contains 20 pairs 
> of senders and receivers; each sender needs to send some messages to 
> the 20 receivers in the same group. The performance is measured by the 
> time taken, less is better.)
>  
>      The tests are carried out on an Intel server with 2 quad-core 
> processors and 4G memory.
>      I am surprised with results I got:
>      (1) SMP enable +S 8
>      root@REDACTED:~/hackbench# \time ./run_one_erl.sh
>      Time is 62.260995
>      295.67user 110.62system 1:14.27elapsed 546%CPU (0avgtext+0avgdata 
> 0maxresident)k
>      11776inputs+8outputs (27major+90965minor)pagefaults 0swaps
>  
>       The performance is 62 sec and the oprofile shows 28% cpu time is 
> using in pthread_mutex_*.
>  
>       (2) SMP disable
>       root@REDACTED:~/hackbench <mailto:root@REDACTED:%7E/hackbench># \time 
> ./run_one_erl.sh "-smp disable"
>       Time is 54.14644
>       54.23user 0.33system 1:05.66elapsed 83%CPU (0avgtext+0avgdata 
> 0maxresident)k
>       3968inputs+8outputs (22major+36520minor)pagefaults 0swaps
>  
>       The performance is 54 sec and using only 83% cpu.
>  
>       So it seems the erlang has problems with using all the smp 
> resources for serious lock contention in smp scheduler. Am I right?
>       And because I am new to erlang, the hackbench.erl may be in bad 
> encoding, which will harm the performance. Can anyone help me review 
> my code?
>  
>       I attach both the original C version of hackbench and my erlang 
> version one.
>  
>       Thanks a lot!
>       (I am sorry If it is the wrong place to post this letter.)   
>
> -- 
> Best Regards,
> Jiang, Wei
> ------------------------------------------------------------------------
>
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org



More information about the erlang-questions mailing list