Linux. Network Tuning

Networking buffer size

To prevent data loss, recommended to increase the networking buffer size.

The buffer size options should be defined in the /etc/sysctl.conf file. Recommended to use next values:

net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_default = 8388608
net.core.wmem_max = 16777216
net.ipv4.udp_mem = 8388608 12582912 16777216
net.ipv4.tcp_wmem = 4096 4194394 16777216

To apply changes restart system or launch:

sysctl -p

You can verify the current values with next command:

sysctl net.core.rmem_default net.core.rmem_max net.core.wmem_default net.core.wmem_max net.ipv4.udp_mem net.ipv4.tcp_wmem

Reverse Path Filtering (rp_filter)

is a technique for the purposes of ensuring loop-free forwarding of multicast packets in multicast routing.

If your server has several network interfaces, recommend to set routes for multicast groups. If this is not applicable and interface is defined in the source or destination address you should disable rp_filter.

Append into the /etc/sysctl.conf file next lines:

net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.eth0.rp_filter = 0

First two line is identical for any servers. Third line is depend of the interfaces names. Append lines, like a third, for each interface and replace eth0 with the name of interfaces.

To apply changes restart system or launch:

sysctl -p