wnd's weblog


July 2007
Mo Tu We Th Fr Sa Su
25 26 27 28 29 30 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
Categories
Archive

Trickle, userspace bandwidth shaper

10 July 2007 10:11:09 network, software

I'm sitting at work, reading my email though my home computer, listening to Nectarine. I've been listening Nectarine and Kohina exclusively for ages. For some reason I'm suddenly totally fed up with these tunes. I start transferring some music (legally ripped from CDs I own, of course) from my home computer to my workstation here, just to realize reading email has suddenly become very sluggish. That is something you get with an asymmetric xDSL-cable with no traffic shaping set.

I've used Wondershaper to set up intranet-global traffic shaping rules back home, but since my upstream limit varies from day to day, it's not very practical. One day I can upload 80 KiB/s just fine, another day mere 50 KiB/s will bring my SSH-connections to near-halt. Obviously I should be shaping the traffic per process. This is where Trickle comes in picture.

In the most basic use case Trickle is trivial to use. To copy a file to remote host using scp, you can limit the upload speed to, say, 40 KiB/s:

trickle -u 40 scp bigfile host:

As I'm copying several files from my home computer while at work, I just issue the following command:

trickle -d 40 -t 0.1 ssh kikai \
	'tar -cf - audio/Christopher_Franke_-_Babylon_5' \
	| tar -xvvf -

Since compiling from the sources available on Trickle website at monkey.org didn't work out too great, I grabbed the sources (and patches) from local Debian repository.

Permalink