Sunday, June 11, 2006

tuning Windows for faster downloads

I see consistent download speeds of about 1 Mb/s from Comcast on my W2K system at home and 4+ Mb/s from another computer running Linux. I was bothered by this but not enough to do anyhing about it. When an XP laptop running on better hardware could do no more than the measly 1 Mb/s, I decided to do some digging into the performance setup.

How does one measure download speeds? There are a bunch of websites running applets that will run some diagnostics and give you details. I like this one available from the Argonne National Laboratory:
http://miranda.ctd.anl.gov:7123/
It gives you information about upload and download speeds, and underlying network characteristics.

It turns out that the default TCP settings on Windows are very conservative and limit download speeds on networks with larger round-trip times between the two end-points, ie. your average cable or DSL setup. It does not make a difference on faster LANs such as those at work. A few tweaks to the registry and the obligatory reboot later, the Windows boxes were doing much better.

You have to add three new entries:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
GlobalMaxTcpWindowSize REG_DWORD 131400 (decimal)
TcpWindowSize REG_DWORD 131400 (decimal)
Tcp1323Opts REG_DWORD 3


THESE CHANGES APPLY TO BOTH W2K AND XP. (I have done it on both.)

What does this do? This reserves more space for the TCP buffer where packets can accumulate, allowing the sender to send more unacknowledged data rather than having to send a small amount of data and wait for an acknowledgement before sending more. It allows more bytes to be "in transit", thus achieving faster downloads.

More details at:
http://rdweb.cns.vt.edu/public/notes/win2k-tcpip.htm

RFC 1323, referenced above in one of the registry keys, describes extensions to the TCP protocol for achieving better performance.

If you want to get really hard-core with tuning TCP/IP, the Pittsburgh Supercomputing Center has published a tutorial.

No comments: