<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>We've had good success tweaking the kernel buffer sizes on servers with a lot of UPD traffic in the past. I found the following in an old shell script that might do the trick:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><div><div><span style="background-color: rgba(255, 255, 255, 0);">sudo sysctl -w net.core.rmem_max=<a href="tel:8000000" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="0">8000000</a></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">sudo sysctl -w net.core.wmem_max=<a href="tel:8000000" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="1">8000000</a></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">sudo sysctl -w net.ipv4.route.flush=1</span></div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">- those change the read and write buffer sizes; there are a whole ton of other options, but we’ve found those two to be sufficient on servers with lots of UDP traffic in the past.  Google will no doubt tell you all the others if you’re bored ;)</span></div><br>Sent from my iPhone</div><div><br>On 18 Nov 2016, at 21:18, pablo platt <<a href="mailto:pablo.platt@gmail.com">pablo.platt@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div><div><div>Hi,<br><br></div>I have a UDP erlang media server running on Ubuntu 16.04 in a Virtual Private Server (VPS) with 100 connected clients.<br>10 clients send 1Mbps. Each packet is 1KB. <br></div>All clients receive 1Mbps.<br></div><div>Every client has a pid that holds a gen_udp socket.<br></div><div><br></div><div>I see packet loss on the clients. I'm trying to find what cause the packet loss and how to fix it.<br></div><div>mtr -u <server> show no loss.<br>netstat -su show that RcvbufErrors increases over time<br></div><div>Does this means that packets are dropped between the linux kernel and Erlang?<br><br>The socket is created with gen_udp:open(0, [binary, {active, once}])<br>The default gen_udp socket settings my machine is:<br>buffer = 8192<br>recbuf = 16384<br>sndbuf = 212992<br><br></div><div>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?<br><br></div><div>Does sndbuf has an effect on UDP socket or only TCP socket?<br><br>What are the recommended settings for buffer, recbuf and sndbuf for 1Mbps UDP socket?<br></div><div>Do I need to change the kernel settings as well?<br><br></div><div>What else can cause packet loss?<br></div><div><br></div><div>Thanks<br></div><div><br></div><div><br><br></div><div><br></div><div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>erlang-questions mailing list</span><br><span><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a></span><br><span><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></span><br></div></blockquote></body></html>