UDP Buffer Tuning for 4K Slicers
Linux places very restrictive limits on the performance of UDP protocols by limiting the size of the UDP traffic that is allowed to buffer on the receive socket.
When using 4K Slicers, it is recommended to update these settings. With non-4K Slicers, changing these settings will not negatively impact performance.
After the settings are updated, reboot to ensure all processes start with the new limits.
Kernel Buffers
You can view your current kernel buffer sizes with:
> sysctl -a | grep rmem
net.core.rmem_default = 212992 <---- INCREASE ME
net.core.rmem_max = 212992 <---- INCREASE ME
net.ipv4.tcp_rmem = 4096 87380 6291456
net.ipv4.udp_rmem_min = 4096
To set new values:
echo "#increase UDP receive buffers to 25 MB" >> /etc/sysctl.conf
echo "net.core.rmem_max=26214400" >> /etc/sysctl.conf
echo "net.core.rmem_default=26214400" >> /etc/sysctl.conf
Hardware Buffers
These values will vary based on the hardware in the system.
To view your current hardware buffer settings:
ethtool --show-ring eth0
Ring parameters for eth0:
Pre-set maximums:
RX: 4096
RX Mini: 0
RX Jumbo: 0
TX: 4096
Current hardware settings:
RX: 512
RX Mini: 0
RX Jumbo: 0
TX: 512
To increase the NIC buffers:
/sbin/ethtool --set-ring eth0 rx 4096 tx 4096
/sbin/ethtool --set-ring eth1 rx 4096 tx 4096
Ulimits
The ulimit
command in Linux is used to control the resource limits for user processes. It provides a mechanism for setting limits on various system resources, such as memory usage, file sizes, and the number of processes that a user can create. It is recommended to set stack size, memory size, and virtual memory to unlimited per:
cat >> /etc/profile.d/ulimit_max.sh << EOF
#!/bin/sh
#stack size
ulimit -s unlimited
#memory size
ulimit -m unlimited
#virtual memory
ulimit -v unlimited
EOF
chmod 755 /etc/profile.d/ulimit_max.sh
Updated 23 days ago