[erlang-questions] Heavy duty UDP server performance

Lukas Larsson <>
Tue Feb 9 15:57:21 CET 2016


Hello,

On Wed, Feb 3, 2016 at 5:23 PM, Max Lapshin <> wrote:

> When we use plain gen_udp to accept 200-400 mbit of incoming MPEG-TS
> traffic in flussonic, we use about 50% of moderate 4 core xeon e3 server.
>
> When we switch to our driver implementation of udp that collapses several
> contiguous udp messages into single big message (it is allowed for mpegts)
> we reduce usage to 15-20%
>
> I can't tell that it is "badly written udp in erlang", just messaging is
> rather expensive.
>

Do you think that it is the batching that makes the performance difference?
In that case do you think adding an option to gen_udp that does batching
would help enough? There is already read_packets as an option, and maybe it
makes sense to have an option that batches all reads done by read_packets
into one erlang message.

i.e. you get something like:

{udp_batch, Socket, IP, InPortNo, [Packets]}

or possibly

{udp_batch, Socket,  [{IP, InPortNo, Packet}]}

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160209/4f39c8ed/attachment.html>


More information about the erlang-questions mailing list