Forum Discussion
danielo303_1961
Feb 17, 2012Nimbostratus
iRule: redirect to pool based on app response time?
I would like to use an iRule to direct traffic based on the response time of the back-end resource pool. Under normal operations, incoming requests (these are SOAP-based queries) will go to the primary resource pool. When the primary pool becomes unresponsive (response slower than 5-10 seconds), requests should be directed to a secondary pool which is configured to basically tell the client "come back later".
I am using priority groups and health monitors to approximate this mechanism currently. But I think if I could find the right tools in iRule I would have more precise control.
Basically I need something like:
when HTTP_REQUEST {
[code to check response time here...]
if response_time < 10 {
pool primary_pool
return
}
else {
pool secondary_pool
return
}
}
Is there a command to test the back-end response? We are on BIG-IP 9.4.3
Thanks!
- HamishCirrocumulusHmm...
- hooleylistCirrostratusYou could use the after command in 10.0+ to set a timer and select a new pool if the currently selected server doesn't reply. I think you'd need to call LB::detach in the after script and then call the second pool using the pool command.
- hooleylistCirrostratusOr instead of selecting another pool, you could just send the response content from the iRule itself using HTTP::respond:
- danielo303_1961NimbostratusHoolio, Hamish
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