Forum Discussion
marsmann_58298
Nimbostratus
Oct 15, 2007Check/Get page load response after HTTP header checks ok
Hi all,
I am brand spankin' new to the F5's. I come from a former Cisco CSS environment so this is a big change for me. I would appreciate some help on the following simple request. I want to have the F5 do:
* User requests site/app via VIP address
* F5 receives request, checks webserver farm/pool
* Establishes connection with web server
* Gets a 200 ok (or relevant header code)
* Establishes session, applies cookies/stickies
* Serves page to client
Here's where I need help
* After it receives a 200 ok and starts serving up the page IF the page takes more than "x" seconds or higher (slow response on page load) mark the server as "down" and reconnect to a new server in the farm/pool.
Can this be done? I've been reading into EAV and monitors and so far what I have found is that an IRule will be the best way to do this. I just need some guidance or a good starting point unless someone here already knows exactly how to do this. Thanks in advance.
- Deb_Allen_18Historic F5 AccountThere is no reliable way to do this currently using iRules.
- marsmann_58298
Nimbostratus
thanks for the response. - Deb_Allen_18Historic F5 AccountWell, if you want start over & resend the request to a new server after the payload is received, you could keep track of the total time since the 200 OK was seen & react accordingly. It seems like you'd just be creating more latency, though, not improving the response time, if your servers begin to respond slowly.
HTHwhen RULE_INIT { set ::tMax 30 } when HTTP_REQUEST { set req HTTP::request } when HTTP_RESPONSE { if {[HTTP::status] == 200}{ set t0 [clock seconds] HTTP::collect [HTTP::header Content-Length] } } when HTTP_RESPONSE_DATA { if {[clock seconds] > [expr {$t0 + $::tMax}]}{ LB::detach LB::down LB::reselect HTTP::retry $req } else { HTTP::release } }
- Deb_Allen_18Historic F5 Account(Oops!
- marsmann_58298
Nimbostratus
Excellent. Thank you for your time and assistance. I think I see your point about the new potential latency with dropping and re-establishing connections. I'm not sure if that will be better or worse than the current configuration. I guess I will try it out and see. - marsmann_58298
Nimbostratus
hmmm... so I get this error when trying to apply/create the new iRule: - marsmann_58298
Nimbostratus
ok. figured out the errors and created the rule. I also removed the LB::reselect entry under HTTP_RESPONSE_DATA section and just defined my pool to reselect on a "down" server so in theory (I'm thinking) this should handle the reselection for me if my iRule flags a host as "down". - Deb_Allen_18Historic F5 AccountOh, I'm sorry, that should be a global variable.
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