It’s been mailed and blogged about to death, but I’ll explain how to increase you TCP performance for usage on a laptop or notebook that will having heavy bandwidth usage. With a common cable provider and wireless device ratings these days you can get about 2 MB/sec connections. However, it’s unlikely you’ll find many HTTP servers that are willing to give you that much bandwidth in a single connection, but BitTorrent (and possibly zysnc, jigdo, and other distribution systems) may make heavy interchange between many servers sending a lot of TCP packets.
The default configurations for TCP in Ubuntu and Debian are good, but they aren’t profiled to meat your specific connection. Last I checked I believe they are defaulted to a DSL-like connection, which is probably somewhere in the middle-ground between dial-up and high performance broadband. Here are some simple additions you can make to your /etc/sysctl.conf file (as root):
net.core.rmem_default = 524288 net.core.rmem_max = 524288 net.core.wmem_default = 524288 net.core.wmem_max = 524288 net.ipv4.tcp_wmem = 4096 87380 524288 net.ipv4.tcp_rmem = 4096 87380 524288 net.ipv4.tcp_mem = 524288 524288 524288 net.ipv4.tcp_rfc1337 = 1 net.ipv4.ip_no_pmtu_disc = 0 net.ipv4.tcp_sack = 1 net.ipv4.tcp_fack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_ecn = 0 net.ipv4.route.flush = 1
The easiest way to make these configuration changes and apply them is to press ALT+F2 and run gksudo gedit /etc/sysctl.conf (you can copy and paste that), which will open up the text editor. Paste the above changes at the end of the file, save, and exit. Now press ALT+F2 again and enter gksudo sysctl -p to apply these changes. If you want to see what these commands are doing you’ll have to press the Run in Terminal button instead of just Run.
Another trick is using ionice to give different processes more priority on reading and writing to your file system. A good example is the Transmission torrent client, which I prefer to run in the background most of the time. You have to get the Process ID (PID) by using the System Monitor, which can be ran from the Administration menu or by pressing ALT+F2 gnome-system-monitor. Go to the process list and find the name of the program (transmission in this example), copy the PID, and then press ALT+F2 gksudo ionice -c 3 -p 1234 where 1234 is instead the PID. I used 3 here to make it use Idle scheduling, but you can use 1, 2, and 3 for varying degrees. See man ionice for how that works in detail.
It’s interesting to see what’s happening with the latest Ubuntu (9.10, Karmic Koala), which is in