Limiting bandwidth for testing

Oftentimes I find myself developing for mobile or potentially low-bandwidth situations while connected to gigabit ethernet. Conservative use of libraries and minification techniques are important defensive programming measures in this situation, but nothing beats being able to test things at the intended bandwidth. trickle provides a nice way userspace way of simulating a low-bandwidth environment.

Step 1: Install Trickle

sudo apt-get install trickle

Step 2: Use Trickle

trickle -s -d 50 -u 50 -w 100 firefox
  • -d : Limits download bandwidth to X KB/s
  • -u : Limits upload bandwidth to X KB/s
  • -s: Run in stand-alone mode, don't use the daemon
  • -w: Use an aggressively short peak detection window of 100 KB