Why is my connection via ssh tunneling much slower than other connections to a remote machine?

Solution 1:

When you ssh into the box, you are making a connection between your computer and the server; it's like you are sitting in front of the server looking at a terminal. When you run wget, the server uses its internet connection to download the file, not your home internet connection. Hopefully this graphic will help:

A SSH connection: home ===> through your ISP ===> linux box's ISP ===> linux box

A wget: linux box (just received a command to wget) ===> linux box's ISP ===> download server

This means that the connection between the linux box and its ISP is 20 MB/s. Your internet connection is slower at 1Mbit. (Also realize that 1Mbit/s is not the same at 1 Mbyte/s; Mb = megabit, MB = megabyte)

Solution 2:

If you're using Windows XP and if the linux box is a long way away, in network terms, you might need to use TCP window scaling.

In brief, there's a limit to the transfer rate achievable with basic TCP connections. This was recognised as a problem and addressed in 1992 in RFC 1323, which introduced TCP Window Scaling. Supported since Windows 2000, it wasn't enabled by default until Windows Vista, so in older versions of Windows you need to turn it on manually.

Here's one of many sites which explain how: http://www.psc.edu/networking/projects/tcptune/OStune/winxp/winxp_stepbystep.html