Skip to content

Instantly share code, notes, and snippets.

@kstevens715
Created January 22, 2013 20:51
Show Gist options
  • Save kstevens715/4598301 to your computer and use it in GitHub Desktop.
Save kstevens715/4598301 to your computer and use it in GitHub Desktop.
Throttle your loopback interface in Linux to test low bandwith. I was testing an AJAX file upload progress bar and found this helpful.
# Throttle LO interface
sudo tc qdisc add dev lo root handle 1: htb default 12
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 20kbps ceil 20kbps
sudo tc qdisc add dev lo parent 1:12 netem delay 1000ms
# Go back to the way things were.
sudo tc qdisc del dev lo root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment