[erlang-questions] what does suspend do ?

Paul Peregud paulperegud@REDACTED
Mon Feb 3 07:57:02 CET 2014


Not sure about suspend, but you might be hitting locks a lot. Compile
erlang with  lcnt - those suspends maybe just a result of optimistic
spinning on locks.
On Feb 2, 2014 10:38 PM, "Philip Clarke" <send2philip@REDACTED> wrote:

> Hi,
>
> I have been doing some profiling using fprof on my system.
> Using fprof I see that ets:select is calling suspend.
>
> I suspect that I have found a bottleneck where I have an ets table with
> write_concurrency defined and there are lots of processes doing reads
> thousands of times per second.  But my question is more general to
> profiling.
>
> What exactly does suspend do ?  I suspect it may be an indication that my
> process has run out of reductions and is preempted by the scheduler ?
> Could anyone confirm please ?
>
> Just in case it is useful, here is the relevant part of my fprof analysis
> file.
>
> {[{{mymodule,get_values,1},           6, 2992.735,   31.313}],
>  { {ets,select,2},                                6, 2992.735,   31.313},
>     %
>  [{suspend,                                      92, 1707.908,    0.000},
>   {{lists,sum,1},                                 6, 1251.655,    0.709},
>   {garbage_collect,                               7,    1.859,    1.859}]}.
>
> {[{{ets,select,2},                                6, 1251.655,    0.709}],
>  { {lists,sum,1},                                 6, 1251.655,    0.709},
>     %
>  [{{lists,sum,2},                                 6, 1250.946,    0.047}]}.
>
> {[{{lists,sum,1},                                 6, 1250.946,    0.047},
>   {{lists,sum,2},                              20647,    0.000, 1241.206}],
>  { {lists,sum,2},                              20653, 1250.946, 1241.253},
>     %
>  [{suspend,                                      10,    9.693,    0.000},
>   {{lists,sum,2},                              20647,    0.000,
> 1241.206}]}.
>
> Thanks
> Philip
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140203/43c9b546/attachment.htm>


More information about the erlang-questions mailing list