Procedure for RHL9 - tuning TCP for fast WAN networks

Glen Turner glen.turner at aarnet.edu.au
Wed May 14 11:42:46 CST 2003


Hope someone finds this useful.
-------------- next part --------------
                   TUNING TCP FOR FAST ETHERNET WAN
                          (Red Hat Linux 9)

The Linux kernel isn't tuned for long-haul rates of 100-500Mbps, so it
performs sub-optimally on AARNet and other big pipe networks.

Edit

  /etc/sysctl.conf
    # Increase socket buffer size
    net.core.rmem_max = 8388608
    net.core.wmem_max = 8388608
    net.core.rmem_default = 131072
    net.core.wmem_default = 131072
    # Alter TCP buffer size autotuning parameters
    net.ipv4.tcp_rmem = 4096 87380 8388608
    net.ipv4.tcp_wmem = 4096 65536 8388608
    net.ipv4.tcp_mem = 8388608 8388608 8388608
    # Alter receive interface buffer
    net.core.netdev_max_backlog = 2500

Rather than reboot, install changes using

  # sysctl -p

Add a file

  /sbin/ifup-local
    #!/bin/sh
    if [ -n "${1}" ]
    then
      if [ -x /sbin/ifconfig ]
      then
        /sbin/ifconfig "${1}" txqueuelen 1000
      fi
    else
      exit 1
    fi

  # chmod u=rwx,go=rx ifup-local

For immeidate effect also say

  ifconfig eth0 txqueuelen 1000


NOTES

The script could be improved to only set long queue lengths on fast
interfaces.  This could be tricky as supposedly slow link type such as
PPP might be a "PPP over gigabit ethernet" tunnel or something else
bizaare.


More information about the linuxsa mailing list