Difference between revisions of "Trickle"

From Noah.org
Jump to navigationJump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Category:Engineering]]
 
== Trickle - Simple Traffic Shaping ==
 
== Trickle - Simple Traffic Shaping ==
  
Line 5: Line 6:
  
 
Ubuntu has trickle available via Apt or Aptitude:
 
Ubuntu has trickle available via Apt or Aptitude:
  apt-get install trickle
+
    apt-get install trickle
 
For RedHat systems you need to install from source at [http://monkey.org/~marius/pages/?page=trickle Marius Aamodt Eriksen's Trickle site].
 
For RedHat systems you need to install from source at [http://monkey.org/~marius/pages/?page=trickle Marius Aamodt Eriksen's Trickle site].
 
You will also need to install [http://monkey.org/~provos/libevent/ libevent] before
 
You will also need to install [http://monkey.org/~provos/libevent/ libevent] before
Line 19: Line 20:
 
   trickle -u 75 scp my_big_file.iso host.example.com:.
 
   trickle -u 75 scp my_big_file.iso host.example.com:.
  
To use with rsync you will need to use the -e option in rsync:
+
Newer versions of Rsync already have a "--bwlimit" option, so you may not need to use Trickle.
 +
To use trickle with rsync you will need to use the -e option in rsync:
 
   rsync -a -e "trickle -u 75 ssh" my_directory user@host.example.com:/home/user/backups/.
 
   rsync -a -e "trickle -u 75 ssh" my_directory user@host.example.com:/home/user/backups/.

Latest revision as of 18:42, 7 March 2007

Trickle - Simple Traffic Shaping

Trickle is a super-easy bandwidth limiter. It runs in userspace, so it's easy to install and does not require any extra kernel modules or firewall tweaks.

Ubuntu has trickle available via Apt or Aptitude:

   apt-get install trickle

For RedHat systems you need to install from source at Marius Aamodt Eriksen's Trickle site. You will also need to install libevent before building Trickle.

To use trickle simply put it before any network command that you want to run. You specify upstream bandwith with -u and downstream with -d:

   trickle -u 10 -d 50 your_command

I use Trickle mostly with rsync or scp. For example, say want to copy a large file and your maximum upstream bandwidth is 150 KB/s and you want to use only 75 KB/s for your copy operation:

  trickle -u 75 scp my_big_file.iso host.example.com:.

Newer versions of Rsync already have a "--bwlimit" option, so you may not need to use Trickle. To use trickle with rsync you will need to use the -e option in rsync:

  rsync -a -e "trickle -u 75 ssh" my_directory user@host.example.com:/home/user/backups/.