Recommended buffer sizes for a UDP socket

I’m using UDP sockets for sending and receiving 1mpbs.
What value should I use for recbuf, sndbuf and buffer?
Does the new socket module works the same?
Should I change Linux settings?

inet manual says:

For TCP it is recommended to have val(buffer) >= val(recbuf) to avoid performance issues because of unnecessary copying. For UDP the same recommendation applies, but the max should not be larger than the MTU of the network path.

If recbuf == MTU, would gen_udp drop packets when there is a burst of several UDP packets?

Thanks

2 Likes

See this answer on StackOverflow.

1 Like