martedì 15 settembre 2015

Performance test with simulated network latency

If you have to run performance tests on your private network and you would like to know how would be the performance on the "real" internet network you could solve this adding artificially the latency.

If you have an linux host that you want to make it slower in terms of latency on the ethernet network interface (eth0 by default), run this command to add a run of 200ms of lacency with 50ms of variability using a normal distribution statistic.

Add latency rule:
tc qdisc add dev eth0 root netem delay 200ms 50ms distribution normal

Change latency rule:
tc qdisc change dev eth0 root netem delay 200ms 20ms distribution normal

List the current rules:
tc -s qdisc ls dev eth0

Delete all rules:
tc qdisc del dev eth0 root

Commands source info:
http://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux

To get all network interfaces available:
 /sbin/ifconfig -a


The simulated latency could be used for example like in the following picture:

In this scenario with RPT (IBM Rational Performance Tester) executed performance test calling Server1 and Server2 with the latency introduced on the Server1.



Nessun commento:

Posta un commento