Tuesday, December 14, 2010

simulate a distant host in localhost

simulate 200ms pings. (100ms each leg)
tc qdisc add dev lo root handle 1:0 netem delay 100msec


Restore it back to normal again with:

tc qdisc del dev lo root


TODO: script to set that every second to a random value from 10 to 100

also:
iprelay -b30000 8000:localhost:80


references
  • from http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
  • also in http://news.ycombinator.com/item?id=2004790
  • docs in http://www.linuxfoundation.org/collaborate/workgroups/networking/netem

No comments:

Post a Comment