Simulating a High-Latency Network Traffic

Latency is extremely important for web performance since every HTTP connection involves a round trip to the server and there is limited concurrency to avoid this. It can be very useful to see what a high-latency connection will look like and can highlight some problems you were not expecting. Especially useful, it can make the differences between two different implementations more pronounced.

To simulate latency use the tc (traffic control) software from the Linux command line. Adjust the delay as you see fit.

[root@box] # tc qdisc add dev eth0 root netem delay 42ms

This is using the netem module which has several features to configure packet loss, duplication, and latency. (You can find these documented in your systems manual pages of course).

To remove the latency either reboot or run the following:

[root@box] # tc qdisc del dev eth0 root
Advertisements
Simulating a High-Latency Network Traffic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s