How to enlarge Linux UDP buffer size?

Posted on In QA

One of the most common causes of UDP datagram lost on Linux is an undersized receive buffer on the Linux socket. How to enlarge Linux UDP buffer size?

On Linux, you can change the UDP buffer size (e.g. to 26214400) by (as root):

sysctl -w net.core.rmem_max=26214400

The default buffer size on Linux is 131071.

You can also make it permanent by adding this line to /etc/sysctl.conf:


Reference: Improving UDP Performance by Configuring OS UDP Buffer Limits. It also provides methods for changing UDP buffer sizes on Solaris, FreeBSD, Darwin and AIX.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published.