Here's a quick summary of how to set the max and default buffers for some common OS's:
Linux 2.2.x |
add the following to
/etc/rc.d/rc.local
echo 8388608 >
/proc/sys/net/core/wmem_max |
Linux 2.4.x |
Add the following to
/etc/sysctl.conf, and then run "sysctl -p"
# increase Linux TCP buffer limits net.core.rmem_max = 8388608 net.core.wmem_max = 8388608 net.core.rmem_default = 65536 net.core.wmem_default = 65536 # increase Linux autotuning TCP buffer limits # min, default, and max number of bytes to use net.ipv4.tcp_rmem = 4096 87380 8388608 net.ipv4.tcp_wmem = 4096 65536 8388608 # number of pages, not bytes net.ipv4.tcp_mem = 4096 4096 4096 Note: Linux 2.4 has a pretty good sender-side autotuning mechanism, so that setting the opitimal buffer size on the sender is not needed, assuming you have set large buffers on the recieve side. This is very nice! The 3 values are min, default, and max. Make sure you set the max large enough. See the IP Sysctl tutorial or here for more information. However, Linux 2.4 has some other strange behavior that one needs to be aware of. For example: The value for ssthresh for a given path is cached in the routing table. This means that if a connection has has a retransmit and reduces its window, then all connections to that host for the next 10 minutes will use a reduced window size, and not even try to increase its window. The only way to disable this behavior is to do the following before all new connections (you must be root):
sysctl -w net.ipv4.route.flush=1
Another thing you can try to increase TCP throughput on Linux is to increase the
size of the interface queue. To do this, to the following:
A similar setting for the receive host is to increase netdev_max_backlog. For example:
For more information on how Linux 2.4 TCP
works, see Tom
Dunigan's page on TCP autotuning. |
Solaris |
create a boot script similar to
this (e.g.: /etc/rc2.d/S99ndd)
For solaris 2.6, also install the SACK patch. |
IRIX |
edit the file: /var/sysgen/master.d/bsd, and
set:
The maximum buffer size under Irix 6.5 is 1MB, and is not changeable. |
FreeBSD |
add this to /etc/rc.local (or some other
boot script):
For more info see: FreeBSD Network Tuning Info |
Others Operating Systems | See the PSC TCP performance tuning guide. |
Please send information on Windows and other operating systems to BLTierney@lbl.gov