Tweak TCP settings for possible speed increases
Nov 02, '01 10:03:18AM • Contributed by: Erik Toh
Depending on your kind of connection to the Internet, you may be able to improve your network performance under OS X by tweaking the TCP receive window size. In my case, I was downloading the OS X 10.1 Developer Tools, which consists of 19 segments, 18 of which are 10 MB in size (the last being around 7 MB). A typical segment download took me 8 minutes, but after the tweak it was cut in HALF!
Needless to say this is an immense improvement, considering that I was still using the same connection. You can tweak the TCP receive window size by doing this:
%sudo sysctl -w net.inet.tcp.recvspace=40960
In this example I'm changing the size to 40960, or 40 KB. OS X defaults to 32 KB which is adequate for most connections, but since you have better knowledge of network conditions, you can make use of it to get results like I did. Experiment with other values to find the optimum.