[erlang-questions] Number of threads are doubled when enable smp ?

Alex Feng sweden.feng@REDACTED
Tue Dec 13 10:54:39 CET 2016


Hi,

When I was doing some performance testing, I found that the number of
threads just doubled if I enabled the smp (erl -smp auto).  I haven't
started to run anything, just wondering what the extra threads are doing
with smp enabled ?


%% with smp option enabled, we have 22 thread running under beam.smp

484: ~/erlang/test  > top -H -p 699

top - 10:41:40 up 205 days, 22:31, 72 users,  load average: 1.22, 1.65, 1.97
Tasks:  22 total,   0 running,  22 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.0%us,  4.7%sy,  0.0%ni, 88.8%id,  0.0%wa,  0.0%hi,  0.4%si,
 0.0%st
Mem:     32241M total,    28556M used,     3684M free,      842M buffers
Swap:        0M total,        0M used,        0M free,    14000M cached

  PID   PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND
  699   20   0 1757m  20m 2980 S      0  0.1   0:00.05 beam.smp


  703   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  704   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  705   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  706   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  707   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  708   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  709   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  710   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  711   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  712   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  713   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  714   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  716   20   0 1757m  20m 2980 S      0  0.1   0:00.03 beam.smp


  717   20   0 1757m  20m 2980 S      0  0.1   0:00.22 beam.smp


  718   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  719   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  720   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  721   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp


  722   20   0 1757m  20m 2980 S      0  0.1   0:00.02 beam.smp


  723   20   0 1757m  20m 2980 S      0  0.1   0:00.02 beam.smp


  724   20   0 1757m  20m 2980 S      0  0.1   0:00.00 beam.smp



%% with smp option disabled, we have 11 threads running under beam

484: ~/erlang/test  > top -H -p 31599

top - 10:39:35 up 205 days, 22:29, 72 users,  load average: 1.21, 1.88, 2.08
Tasks:  11 total,   0 running,  11 sleeping,   0 stopped,   0 zombie
Cpu(s): 50.0%us,  0.0%sy,  0.0%ni, 50.0%id,  0.0%wa,  0.0%hi,  0.0%si,
 0.0%st
Mem:     32241M total,    28549M used,     3691M free,      842M buffers
Swap:        0M total,        0M used,        0M free,    14000M cached

  PID   PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND


31599   20   0 1579m  15m 2836 S      0  0.0   0:00.32 beam


31607   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31608   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31609   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31610   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31611   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31612   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31613   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31614   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31615   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


31616   20   0 1579m  15m 2836 S      0  0.0   0:00.00 beam


Br,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161213/970d9bde/attachment.htm>


More information about the erlang-questions mailing list