Speed up your ssh connections with compression
By default compression is not enabled for outgoing ssh connections on OS-X. Very simple compression is no problem for modern CPUs and even on a gigabit network it is faster to compress data first before sending it over the network instead of leaving it uncompressed. However compressing data that can’t be compressed anymore (like JPEG files) makes no sense. If your typical ssh traffic is not .jpeg or .zip files then read on.
First check if your ssh traffic is compressed by starting a ssh session with the -v switch.
You should spot two lines:
none at the end of each line.
Compression can be enabled by default for all ssh sessions.
Just put a file (or modify it if it’s already there) called
config into your ~/.ssh/ directory and add the following two lines:
Another ssh session with -v should give you the following:
How much faster is it?
cat some-50mb-long.log to output the content of some 50mb log file directly to my ssh session and noticed a 3-4x speed increase on compressed data of a normal web server log file.
As you are probably not displaying 50mb files in your ssh session on a daily basis you might notice a slightly more responsive remote and less load on you network.
If you've read this far you might as well follow me on Twitter here.