Forum Discussion
Injecting latency into application requests?
is it possible to inject latency into client requests for an application to degrade the user experience?
the goal is to degrade performance of an application by a set amount no matter what the usage is to help expedite migration from one application to another.
Initially I thought of limiting the bandwidth, but when traffic is below the threshold, the application will perform normally. I want the performance to be degraded no matter what the traffic amount is.
Is this possible with an iRule?
thanks in advance,
John.
- nitassEmployeeis after command usable?
- hooleylistCirrostratusYou might be able to call HTTP::collect to hold the request and then use after to call HTTP::release to release the request.
- Colin_Walker_12Historic F5 AccountIt is definitely possible, the problem is that, depending on how you end up writing the rule, you may be delaying all traffic going through the box by that amount. It's important to avoid loops and blocking commands if you only want to degrade traffic bound for a particular VIP. A collect, as Aaron mentioned, is probably the safest way to suspend a single connection, just be wary of the performance implications of this.
- nitassEmployeeHi Aaron/Colin,
- hooleylistCirrostratusI think you'd want to call HTTP::collect with no collection size to hold the connection and then use 'after' to call HTTP::release. This is similar in concept to using HTTP::collect to hold the current request while you perform OCSP or other authentication.
- nitassEmployeethanks Aaron!
- Colin_Walker_12Historic F5 AccountThe after command is non blocking. It will fire and allow the connection to continue processing as normal, so there would be no inherent latency. That is, in fact, the entire purpose of the after command: to allow you to continue processing a session while assigning some task to be done at a specified time. To actually pause the connection and add latency, you need to do something that will suspend things, like a collect, a loop, etc. A collect is likely the safest means is all.
- dubdubNimbostratusAnother thought: could you inject a javascript delay function with a stream profile/expression? Change the body tag to include a javascript snippet that just spins CPU cycles for a bit? http://stackoverflow.com/questions/951021/javascript-sleep
- nitassEmployeeThe after command is non blocking.you mean after is suspend command but it is non blocking. what is different between suspend and blocking??
- Colin_Walker_12Historic F5 Account@dubdub - Yep, you sure could. That would be trusting the javascript and putting the delay on the client, however, meaning you'd be responding from the LTM, trusting the client to hang around and wait, and then re-send a new request after a certain delay. While that would work in many situations, it isn't the same as far as the client is concerned as just inducing delay at the network layer.
when HTTP_REQUEST { after 3000 { pool myPool } }
Recent Discussions
Related Content
* 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