[erlang-questions] UDP buffers and packet loss

pablo platt pablo.platt@REDACTED
Fri Nov 18 22:18:29 CET 2016


I have a UDP erlang media server running on Ubuntu 16.04 in a Virtual
Private Server (VPS) with 100 connected clients.
10 clients send 1Mbps. Each packet is 1KB.
All clients receive 1Mbps.
Every client has a pid that holds a gen_udp socket.

I see packet loss on the clients. I'm trying to find what cause the packet
loss and how to fix it.
mtr -u <server> show no loss.
netstat -su show that RcvbufErrors increases over time
Does this means that packets are dropped between the linux kernel and

The socket is created with gen_udp:open(0, [binary, {active, once}])
The default gen_udp socket settings my machine is:
buffer = 8192
recbuf = 16384
sndbuf = 212992

inet docs says that buffer should be larger than recbuf and sndbuf and will
be set automatically but in my case it is smaller. Is this a problem?

Does sndbuf has an effect on UDP socket or only TCP socket?

What are the recommended settings for buffer, recbuf and sndbuf for 1Mbps
UDP socket?
Do I need to change the kernel settings as well?

What else can cause packet loss?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161118/76ded717/attachment.htm>

More information about the erlang-questions mailing list