betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

17 March 2009

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.


Posted by betabug at 14:09 | Comments (3) | Trackbacks (0)
ch athens
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
Recent Entries
Cycling to Sounion (11/25 08:50)
Yepp it's broken (11/06 14:09)
König Auto in Griechenland (11/02 18:46)
Mal wieder in der Schweiz (10/21 16:51)
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< apache and reverse DNS hostname lookups | Main | got earphones (again) >>
Comments
Re: Shell fun: limit bandwidth on scp

Thanks for the great explanation. Exactly what I was looking for. Why isn't that in the man pages?

Posted by: Alex Bradley at February 03,2010 20:19
Re: Shell fun: limit bandwidth on scp

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!

Posted by: betabug at February 03,2010 21:07
Re: Shell fun: limit bandwidth on scp

perfect, works like a charme :-)

Posted by: Nico Flemming at November 25,2011 06:21
Trackbacks
You can trackback to: http://betabug.ch/blogs/ch-athens/934/tbping
There are no trackbacks.
Leave a comment