<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Jun 20, 2018 at 10:00 PM Rich Neswold <<a href="mailto:rich.neswold@gmail.com" target="_blank">rich.neswold@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Wed, Jun 20, 2018 at 12:07 PM Lukas Larsson <<a href="mailto:lukas@erlang.org" target="_blank">lukas@erlang.org</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">So if anyone is running a performance critical UDP server that has set the "recbuf" to a high value, I really recommend that you lower the "buffer" size to something close to the max expected packet size.</div></div></div></blockquote></div><div><br></div><div>That's interesting because the official documentation says:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>"It is recommended to have val(buffer) >= max(val(sndbuf),val(recbuf)) to avoid performance issues because of unnecessary copying."</div></blockquote><div><br></div><div>Maybe the documentation is wrong because that doesn't make much sense; sndbuf and recbuf are sent to the kernel and are supposed to be bigger than the user's buffer.</div></div></blockquote><div><br></div><div>I think that part of the documentation is mainly written with TCP in mind, not UDP. Also, following the docs works fine if it weren't for the bug uncovered in this mail thread. I'll see what I can do about making the docs better.</div></div></div>