Forum Discussion
Paul_Dawson_103
Nimbostratus
Feb 15, 2006Simulating Latency
Hello,
We are looking to simulate latency on the network to test an application in a WAN environment.
Would it be plausible looking to iRules to investigate if this is possible?
Any pointers/tipes would be appreciated.
8 Replies
- JRahm
Admin
I was thinking for loops. I tested this in the lab, on my BigIP this equates to about 58 milliseconds of delay:when CLIENT_ACCEPTED { set y1 [clock clicks -milliseconds] for { set x 0 } { $x < 100000 } { incr x } {do nothing} set y2 [clock clicks -milliseconds] set time1 [expr $y2 - $y1] log "For loop time is $time1 milliseconds" } - Colin_Walker_12Historic F5 AccountNote that, while this is possible via iRules, it is not recommended and is not the intended use of the language.
This kind of rule can, as you might imagine, introduce serious latency in connections to your BIG-IP, and should only be used in a testing environment.
-Colin - Colin_Walker_12Historic F5 AccountYes, you could...but like I said, I don't recommend putting it in place at all on a production system.
-Colin - patrick_jenny_7Historic F5 AccountYou may wish to consider using DummyNet http://info.iet.unipi.it/~luigi/ip_dummynet/ to simulate a WAN link outside of the BIG-IP.
- BlurredVision_1
Nimbostratus
forgive me if I am wrong, but triggering this on CLIENT_ACCEPTED just means that the initial connection is waylaid. latency is evident on every packet not just the 4th... - Nicolas_Menant
Employee
if you do it on HTTP protocol you may use the same code in when HTTP_REQUEST and/or HTTP_RESPONSE - Colin_Walker_12Historic F5 AccountThis would simulate latency per session, not per packet, you're correct.
Colin - Cyril_M
Altostratus
According to this https://devcentral.f5.com/s/articles/irules-and-wait-states-after-makes-life-better you'd rather use this irule
when HTTP_REQUEST { after 50 }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects