How to enlarge Linux UDP buffer size?

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?

asked Jun 14, 2014 by Eric Z Ma (44,280 points)

1 Answer

 
Best answer

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:

net.core.rmem_max=26214400

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.

answered Jun 18, 2014 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...