[erlang-questions] UDP receive performance

Danil Zagoskin z@REDACTED
Thu May 24 13:27:43 CEST 2018


I've made a simple example.

The code is at
https://gist.github.com/stolen/40eebd6225faf821153f1eeb5374f068

I added the 239.0.0.0/8 route as direct loopback (lo0 in OSX) to avoid
network driver overhead.

40 dummy readers are enough to eat almost all 4 cores on my macbook (quite
old i7 2 GHz):

Erlang/OTP 21 [RELEASE CANDIDATE 1] [erts-9.3.1] [source-dfc935298b]
[64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

1> c(udptest).
{ok,udptest}
2> udptest:start_sender({239,9,9,9}, 3999).
<0.82.0>
3> [udptest:start_reader({239,9,9,9}, 3999) || _ <- lists:seq(1, 40)].
[<0.84.0>,<0.85.0>,<0.86.0>,<0.87.0>,<0.88.0>,<0.89.0>,
 <0.90.0>,<0.91.0>,<0.92.0>,<0.93.0>,<0.94.0>,<0.95.0>,
 <0.96.0>,<0.97.0>,<0.98.0>,<0.99.0>,<0.100.0>,<0.101.0>,
 <0.102.0>,<0.103.0>,<0.104.0>,<0.105.0>,<0.106.0>,<0.107.0>,
 <0.108.0>,<0.109.0>,<0.110.0>,<0.111.0>,<0.112.0>|...]
4> msacc:start(10000), msacc:print().
...
        Thread    alloc      aux      bifbusy_wait check_io emulator
ets       gc  gc_full      nif    other     port     send    sleep   timers
...
     scheduler   59.95%    0.62%    0.14%   10.65%    0.00%    1.40%
0.00%    0.39%    0.00%    0.00%    1.74%   17.43%    0.00%    7.62%
0.06%


I'll build the fresh OTP on Linux box and check perf again.

On Thu, May 24, 2018 at 1:58 PM, Jesper Louis Andersen <
jesper.louis.andersen@REDACTED> wrote:

> On Wed, May 23, 2018 at 5:29 PM Danil Zagoskin <z@REDACTED> wrote:
>
>> Hi!
>>
>> We have a performance problem receiving lots of UDP traffic.
>> There are a lot (about 70) of UDP receive processes, each handling about
>> 1 to 10 megabits of multicast traffic, with {active, N}.
>>
>>
>
> Suppose you read the packets, and then throw everything away, as a test.
> Are you then fast enough, or do you have a problem still? Chances are that
> the problem isn't the reception by itself.
>
> memmove just means you are moving memory around a lot, but the question
> is: why?
>



-- 
Danil Zagoskin | z@REDACTED
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180524/8a40fdde/attachment.htm>


More information about the erlang-questions mailing list