Industry Leader in Digital Business

Howto: limit your internet speed for testing purposes (Linux)

I was developing an upload class with progress bar this week which required me to limit my Internet upload speed to just a few Kilobytes. Without this limitation, the progress bar (which belonged to a form accepting small files) would immediately reach 100 percent as the upload was completed in an instant. Though there are various bandwidth shapers for Window available, I ran into the problem that such a tool was not easy to find for Ubuntu. Researching the options, I found a small program called ‘Trickle’ which will not only help during test session, but might also be a nice addition during daily desktop usage. Installation is easy and can be done through the Ubuntu Software Center (search for ‘Trickle’) or through the command line: sudo apt-get install trickle. After installation, you can start up a lot of programs with limited speed to sweet your needs. Some examples:

Chromium Browser (10 Kb/s download, 5 Kb/s upload)
{code}trickle -d 10 -u 5 chromium-browser{/code}

File download (100 Kb/s download
{code}trickle -d 100 wget{/code}

Transmission BitTorrent client (250 Kb/s download, 50 Kb/s upload)
{code}trickle -d 250 -u 50 transmission{/code}

With these commands, Trickle will open the requested program in a so-called sandbox environment. This sand-box environment can be seen as an invisible copy of your Linux desktop which has been changed to limit the network speeds. You will notice that working with Trickle is easy: the sand-box environment is completely hidden and only the requested program will open. Please note that you can close the program and start it using your regular shortcut to reset the allowed bandwidth usage. Or you can start two copies of the program as long as you keep in mind that they will behave differently in terms of speed ;-).

Tricke limitations

Up to now, I found only one program that did not work well with the command which happens to be FireFox. The problem has been reported already to Trickle and FireFox, but a solution has not yet been offered. However, Chromium (the Ubuntu variant of Google’s Chrome) does work well for testing purposes. You can install this program through the Ubuntu Software Center or by using the command: apt-get install chromium-browser.

Related Posts