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 for 1G ethernet adapters:

net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.udp_mem = 8388608 12582912 16777216
net.ipv4.tcp_rmem = 4096 87380 8388608
net.ipv4.tcp_wmem = 4096 65536 8388608

For 10G ethernet adapters:

net.core.rmem_max = 67108864 
net.core.wmem_max = 67108864
net.ipv4.udp_mem = 8388608 16777216 33554432
net.ipv4.tcp_rmem = 4096 87380 33554432
net.ipv4.tcp_wmem = 4096 65536 33554432
net.ipv4.tcp_congestion_control=htcp

For 40G ethernet adapters:

net.core.rmem_max = 134217728 
net.core.wmem_max = 134217728
net.ipv4.udp_mem = 8388608 33554432 67108864
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_congestion_control=htcp

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
?