Back after a long time. Will provide some general updates and introduce you to this fine little cuty called trickle.
Ever stuck with torrent downloads who steal all your bandwidth, and you can’t even open google .com. Talk about limiting download speeds from torrent clients, which never work efficiently. Or how about listening to shoutcast while your firefox blazes away.
Well, I got lazy and avoided blog for a while. But here it starts again. Loads of good things (:)) have accumulated. So expect some crazy posts 😉 in near future.
Recently we went for trekking, when I realized that humans are explorer by nature. It was great fun and a welcome break from the boring life of a software engineer. A band of brothers got really excited and a Biker boys trip to Leh is in pipeline in mid August. Interested people may contact. Plan is to reach upto heights of 6500m above sea level and drive on highest road on earth. 🙂
Well, back to the cute little niffy “trickle”.
We discussed how inefficient the speed limiters are in torrents. That’s because they work on averaging bandwidth, so most of times the spikes wont let you stream music. Moreover, browsers like firefox are so bandwidth thirsty that they would not hesitate to create upto 15 connections for a single site. Say bye bye to your running stream meanwhile.
Well here is the wonder tool, called trickle.
trickle is a portable lightweight userspace bandwidth shaper. It can run in collaborative mode (together with trickled) or in stand alone mode.
trickle works by taking advantage of the unix loader preloading. Essentially it provides, to the application, a new version of the functionality that is required to send and receive data through sockets. It then limits traffic based on delaying the sending and receiving of data over a socket. trickle runs entirely in userspace and does not require root privileges.
Trickle can run in standalone mode, where you can limit a certain application.
trickle -s -u 10 -d 20 firefox
Running above command would limit firefox to download at max 20kB/s and upload max at 10kB/s.
-u = upload rate
-d = download rate
-s = standalone mode.
Running without -s means you can also group a set of trickled applications.
For this you have to run “trickled” which is trickle daemon and handles a group of trickle instances.
So this is like global limit on all trickled applications.
trickled -u 10 -d 20
Now all your tricked instances are under these global limits.
There are some other options as well which you might play with like. I am however happy with the default values:
-w : length – Set peak detection window size to length KB. This determines how aggressive trickle is at eliminating bandwidth consumption peaks. Lower values will be more aggressive, but may also result in over shaping. The default value (512KB) is usually sufficient.
-t : Set smoothing time to seconds s. The smoothing time determines with what intervals trickle will try to let the application transceive 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.
So have a nice time trickling those runaway looters.