Tag Archives: netem

How to emulate a slow connection

Sometimes you would want to emulate a slow connection. For example to better understand a web site performance that you are developing locally.

As you probably know search engines (especially Google) prefers faster sites. Using a slow connection we can better assess the optimizations we may apply to the web application. Every second (or fraction of it) saved can make you earn positions on SERPs.

Linux lets you emulate a slow connection using netem kernel mode throuch tc command. Some examples:


# tc qdisc add dev eth0 root netem delay 300ms 30ms
# tc qdisc change dev eth0 root netem loss 0.10%

These commands will add a random delay between 300 and 30 ms and a packets loss of 0.10% to eth0 interface.
Other features and examples are visible here.

For Windows and Mac (and also linux) I recommend this Java “slow proxy” http://www.dallaway.com/sloppy/.

You can contact me for advices on How to optimize a web site.