Linux – Intermittently “slow” http proxy over ssh tunnel

apache-2.2linuxssh

I have an apache virtual host running a reverse proxy accepting connections from the servers IP. To access, I'm running an SSH tunnel from localhost -> server, and pointing my browsers proxy settings at localhost:ssh-tunnel-port.

Occasionally (I don't have benchmarks) everything running through the proxy connection is slow. When running Opera, Opera notices and informs me I'm using a slow connection.

I have confirmed that the local link to Internet is not the culprit, and this occurs no matter the browser used.

I'm not sure if it's the ssh tunnel (I'm not using a fast cipher) or the proxy server; but the issue is intermittent and direct connections to the server show throughput much higher than what I'm experiencing through the proxy tunnel. Directly connecting to the affected sites shows that they are delivering content noticeably faster than I'm getting through the proxy tunnel.

What can I do to determine why I'm intermittently getting slow throughput? Is using Apache as a reverse-proxy the best (ie, fastest) option?

Best Answer

The only thing you can do to speed things up is using compression on your ssh tunnel. You can use the -c-switch for this.

Ex:

 ssh -D1337 -fN bart@myserver.tld -C