[erlang-questions] UDP receive performance

Valentin Micic v@REDACTED
Mon Jun 25 13:13:52 CEST 2018


On 22 Jun 2018, at 10:27 AM, Lukas Larsson wrote:

> On Fri, 22 Jun 2018, 09:24 pablo platt, <pablo.platt@REDACTED> wrote:
> Does this bug only affect multicast UDP or also normal UDP?
> 
> It effects reception of all UDP messages.
> 
> 
> What values should I use for buffer and recbuf in a UDP socket receiving 1Mbps with 1500 Bytes MTU?
> I thought I need N*MTU recbuf so the pid will be able to handle a small burst of UDP packets.
> 
> There is no need to set buffer larger than your MTU. The recbuf however should be large enough to handle any bursts that may happen. 
> 
> This is what I currently have:
> gen_udp:open(0, [binary, {active, once}, {recbuf, 16*1024}])
> 
> I doubt that you will see any large performance differences by setting the buffer size to, let's say 2*1024. But it will as always depend on your application.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

A high volume testing we have performed using earlier versions (R15+), yielded far less (or rather none) packet drops when recbuf has been set to a higher value.
Cannot recall what were the hardware specs, but I remember that without adjusting recbuf, the packet drops were experienced at the rate that was about 10,000 packet/sec.
With adjustment for recbuf (arbitrarily set to 1MB), we were able to push 70,000 packets/sec without a drop throughout tests.
The testing was not performed to measure impact on CPU, but rather to establish that packet drops were function of recbuf size (and/or sender's sndbuf size).
We have concluded this to be the case for the packet sizes not exceeding MTU.

Kind regards

V/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180625/9f60adaf/attachment.htm>


More information about the erlang-questions mailing list