Tuesday, September 18, 2012

How to Install and Usage Trickle on Ubuntu


Trickle Installation

Trickle it’s available on Ubuntu Software Repository, to install trickle you can install via Ubuntu Software Center or install viaterminal by typing command:
sudo apt-get install trickle

Basic Use Trickle

To use a trickle in standalone mode, you can use a single command, in this method the syntax is:
trickle -d download-bandwidth -u upload-bandwidth command
See Example:
  • Limit the download bandwidth at 100Kbps for wget
trickle -d 100 wget http://cdimage.ubuntu.com/daily/current/precise-alternate-i386.iso
  • Start Firefox limiting its  download to 25 KB/s, and upload badwidth to 15 KB/s
trickle -d 25 -u 15 firefox
  •  Limit to 384kpbs the download bandwidth for a system update via apt-get:
trickle -d 200 apt-get upgrade

Running trickle as a Daemon Collaborative-Mode

To start trickle as daemon mode and limit all the bandwidth, use the command trickled with the following syntax:
sudo trickled -d download-bandwidth -u upload-bandwidth command
This is Example to start the daemon and limit upload 100Kbps and download at 200Kbps
sudo trickled -d 200 -u 100
trickle daemon above will limit the total bandwidth available to all programs run via trickle to 200 KB/s both up and down. if you run a single program using trickle, it can consume 200 Kbps.  Two programs can each consume 100 Kbps

Trickle Configuration File

If you run Trickle, it checks to see if the trickled daemon is running and implements the parameters defined in the file for the program it is running. Trickle will override the options defined in the /etc/trickled.conf file if you specify values with the Trickle command
This is Example of trickle default configuration:
[ssh] 
Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 1
[www] 
Priority = 2 
Time-Smoothing = 5 
Length-Smoothing = 10 
[ftp] 
Priority = 8

0 comments: