inet buffer size for TCP

Frank Muller frank.muller.erl@REDACTED
Thu Dec 12 19:43:18 CET 2019


Hi all

The inet (
http://erlang.org/doc/man/inet.html
) documentation states :

{buffer, Size}

    The size of the user-level buffer used by the driver. Not to be
confused with options sndbuf and recbuf, which correspond to the Kernel
socket buffers. For TCP it is recommended to have val(buffer) >=
val(recbuf) to avoid performance issues because of unnecessary copying. For
UDP [...]


Question: which is best here:

val(buffer) = val(recbuf)

val(buffer) = val(recbuf) + (1/4 *val(recbuf))

val(buffer) = val(recbuf) + (2/4 *val(recbuf))

val(buffer) = val(recbuf) + (3/4 *val(recbuf))

val(buffer) = 2 * val(recbuf)

Is there any optimal value?

/Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191212/dcb289a4/attachment.htm>


More information about the erlang-questions mailing list