Howto Manage Bandwidth Using Trickle

Trickle is a portable application bandwidth shaper lightweight. It can run in collaborative mode “together with trickled” or in stand alone mode. It is a great tool command line based. trickle can be limit application bandwidth, upload or download speed, and prioritizing daemons. You can use Trickle to cap application speeds per application, download, filetype or globally.

Problem:
You have limited bandwidth, which you need to share with some other machines or just between different services on you machine. So you need a tool that can shape, control and manage the bandwidth so everybody can make a responsible use of it.

Solution:
Here is where trickle comes in handy. Install trickle.

For Centos and Fedora
$ yum install trickle

For Debian and Ubuntu
$ sudo apt-get install trickle

Usage:
The syntax is: trickle [-h] [-v] [-V] [-s] [-d rate] [-u rate] [-w length] [-t time] [-l length] [-n path] command man trickle for more details.

Standalone-Mode 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 300kpbs the download bandwidth for a system update via apt-get:
$ trickle -d 300 apt-get upgrade

Daemon Collaborative-Mode Example:

To start trickle as daemon mode and limit all the bandwidth, use the command trickled via sudo or root with the following syntax:

$ trickled -d download-bandwidth -u upload-bandwidth command

# Start the daemon and limit upload 100Kbps and download at 200Kbps
$ 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)

Configuration file:
All the configuration should be done in the file: /etc/trickled.conf Here is an example of that file:

[ssh]
Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 1
[www]
Priority = 2
Time-Smoothing = 5
Length-Smoothing = 10
[ftp]
Priority = 8

Parameters are:
Priority: Sets the priority a session have the lowest the priority number is, the highest priority the protocol have.

Length-Smoothing: Set smoothing length to length KB. The smoothing length is a fallback of the smoothing time. If trickled cannot meet the requested smoothing time, it will instead fall back on sending length KB of data. The default value is 10 KB.

Time-Smoothing: Set smoothing time to seconds s. The smoothing time determines with what intervals trickled will try to let the application transcieve data. Smaller values will result in a more continuous (smooth) session, while larger values may produce bursts in the sending and receiving data. Smaller values (0.1 – 1 s) are ideal for interactive applications while slightly larger values (1 – 10 s) are better for applications that need bulk transfer.

This parameter is customizable on a per-application basis via trickled.conf(5). The default value is 5 s. Remember that trickle only works for TCP connections and not for UDP ones.

jonboy60

I’m a Malaysian, my name is Jon Loh (jonboy60) living in Kuala Lumpur and working in Petaling Jaya, Malaysia. Jonboy60.com is a blog magazine about Linux and other open source softwares. All about to a daily jobs or real life experiences I had since the year 2002 administrating Linux and Windows server in a hosting company. Basically i will be offering Linux tips, howto, tricks, latest news and tutorial. Contact Me for Career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting and expertise requests. Email to me on jonboy60{@}gmail.com. The site I’m running is VenCouture.com – Malaysia Online Fashion Shopping Boutique, VenCouture. We sell fashion clothes, sexy lingeries, baby clothing and etc.

More PostsWebsite

Follow Me:
TwitterFacebook

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*


− 2 = 7

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge