SSH tunnel vs. Squid proxy speed comparison
Tokyo is one of the greatest places to live but once in a while I find sites or services that prohibit connections from outside the US such as Pandora, Hulu, and some books on Audible. Fortunately I have a server in the US so I set about trying to get around these international restrictions by proxying certain connections through the server. Unfortunately my server's connection is not very fast and it's also asynchronous so needed to test proxying methods to determine which, if any, might be able to support streaming content. There may be other ways to proxy but I chose to test an SSH tunnel and a basic Squid proxy. Results below the break.
Baseline
The first thing to do was to get a baseline of the server's connection speed. Speedtest.net is my favorite speed tester because it not only has a cool UI but also has many servers around the world.
According to the test, my server's local speed was 4925kbps down and 798kbps up. I know, that's sad for a server but it's not a public server and I didn't have proxying in mind originally.
SSH Tunnel
The next test was the SSH tunnel using Putty -D dynamic forwarding.

The result of this test was 801kbps down and 217kbps up. Tunneling the connection significantly reduced the "download" value because the download in this case is basically upload from my server. This speed should not exceed the baseline upload speed in theory but it appears that my Tokyo connection to the server is faster than the connection between my server and the speedtest.net server. I'm surprised that the upload was reduced to 217k.
Squid Proxy
The last test used the Squid proxy without SSL
Note that the "ISP" and "distance" fields in the screenshot above describe my Tokyo connection. This is because I'm using Squid in it's default mode which does not anonymize the source IP. Until web services begin blocking proxied connections I'll leave this as is.
The result of this test was 983kbps down and 489kbps up which is surprisingly good. According to Hulu's site, standard content requires 480k or 700k but they recommend 1000Kbps so it may be possible to stream Hulu through Squid. Hi-Res Hulu content probably won't work but Pandora should be no problem at all.
Conclusion
SSH was not designed to be a proxy server but the blogosphere is full of tutorials on tunneling through SSH. The performance difference between SSH tunneling and Squid proxying is significant but it's not clear whether the difference is due to SSH's inherent encryption or the fact that Squid was designed specifically as a proxy. In other words, it could be that enabling encryption in Squid could reduce or nullify that difference.
As far as setup goes, it's much easier in my opinion to setup an SSH tunnel since every distro comes with SSH and all that's necessary is to add a few client side switches when initiating the connection. Squid on the other hand requires an additional package, conf file modifications, and authentication setup if you want to keep your proxy private.


