Skip to content

Instantly share code, notes, and snippets.

@doctyper
Created November 30, 2011 22:11
Show Gist options
  • Save doctyper/1411283 to your computer and use it in GitHub Desktop.
Save doctyper/1411283 to your computer and use it in GitHub Desktop.
Add latency to localhost
# enable
sudo ipfw pipe 1 config bw 50KBytes/s delay 100ms
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80
# disable
sudo ipfw delete 1
sudo ipfw delete 2
@smith
Copy link

smith commented Dec 1, 2011

If you're on a Mac check out /Developer/Applications/Utilities/Network Link Conditioner/Network Link Conditioner.prefpane

See http://9to5mac.com/2011/08/10/new-in-os-x-lion-network-link-conditioner-utility-lets-you-simulate-internet-and-bandwidth-conditions/

@doctyper
Copy link
Author

doctyper commented Dec 1, 2011

Yeah, a potential problem with the NLC is it tries to do too much. I don't need it to drop packets, just to slow down the network. Co-worker was having problems with it earlier, went the command-line route.

@smith
Copy link

smith commented Dec 1, 2011

Cool. Nice hack, but I can totally see myself forgetting to disable it and constantly bitching about wtf is up with our internet here. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment