Shell fun: limit bandwidth on scp
I wasn't really sure if this post should go into the shell fun category.. but anyway here goes a little hint about one sometimes overlooked feature of everybody's beloved OpenSSH scp command: You can limit the bandwidth it uses with the -l parameter. Just give it the maximum number of kilobits/second that it should use.
This parameter can be fun, because it can allow you to surf the web. How so? Imagine you have a limited amount of uplink bandwidth - like on your average ADSL line - ok, no need to imagine much there, you probably are there already. Now you fill up all that uplink bandwidth by beaming a big file to some remote server with scp. What happens is that your asymmetrical pipe is congested and surfing (or irc chatting or whatever) becomes painfully slow. You could go all the way and implement some traffic shaping. Or you could switch to using
scp -l 200 hugefile.tgz example.org:bigstuff/
and thus use only 25kByte/second (200kbit/sec = ~25kByte/sec) of your wimpy 1024kbit/second uplink bandwidth for this. The uplink will take longer, but at least you can get back to read some webcomics - or whatever urgent business you had at hand.