Shell fun: limit bandwidth on scp
... but is that really fun?
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.
Life in Athens (Greece) for a foreigner from the other side of the mountains.
And with an interest in digital life and the feeling of change in a big city.
Multilingual English - German - Greek.
Main blog page
It rained in September
Some of the most sought after posts, judging from access logs and search engine queries.
Apple & Macintosh:
Security & Privacy:
Athens for tourists and visitors:
Life in general:
Thanks for the great explanation. Exactly what I was looking for. Why isn't that in the man pages?
Alex, do you mean all of my post should be in the man page? :-)
The -l option is in the man page on my system, it says that -l "Limits the used bandwidth, specified in Kbit/s." Good enough. My shell fun posts aren't about "stuff that isn't in the man page", but about "stuff that is interesting and you/me might not have noticed in the man page"... or something in that direction anyway. Have fun!
perfect, works like a charme :-)
Or for when you have flatmates complaining and you're trying to do work. Thanks for the tip!
You can trackback to: http://betabug.ch/blogs/ch-athens/934/tbping
There are no trackbacks.