Forum Discussion
sriramgd_111845
Nimbostratus
Dec 10, 2008inspect start of payload
We are planning to add an 'overload' iRule in production, to allow for redirect in case of overload of our application server.
We want users who are already logged to continue with their session, and redirect only users who login after we turn on the redirect iRule.
There is no easy way to differentiate between a login packet and already logged in user packets without inspecting the first n (say 100) character for all POSTs.
This rule will be turned on only during an emergency, and we are going to check CPU utilization in perf. Question is, if I do a
if { [HTTP::method] equals "POST" } {
if { [HTTP::payload 100] starts_with "" }
...
Is this okay? Is getting 100 characters of the payload and comparing with a string more efficient than say getting 200 characters? i.e. if I inspect the first few characters of the payload, is it more efficient than inspecting the whole payload, or is it the same in terms of performance? If so, is there a more efficient way of doing this?
- strongarm_46960
Nimbostratus
sriramgd, no need to iRule this one, why dont you just use a mode of Load ballance, it'll be more effective. - Mike_Lowell_108Historic F5 AccountI agree with jquadri about the overall solution: if you can use Least Connections or Dynamic Ratio (maybe combined with persistence) to load balance new vs. existing users to the least loaded server, that'll be faster than inspecting requests.
- hoolio
Cirrostratus
Hi Mike, - Mike_Lowell_108Historic F5 AccountHmm, try this instead:
- hoolio
Cirrostratus
Sorry for the threadjacking, but thanks Mike for the alternate link. It looks like you fixed the standard page as well. That's a novel rule. Thanks for posting it. - sriramgd_111845
Nimbostratus
Mike, - Mike_Lowell_108Historic F5 AccountSriram: Ah, that makes good sense -- I understand now. An idea to help narrow down the window of when the problem starts would be to setup a fake pool that contains the same webservers as the real pool, but setup this fake pool with a health check that simulates a login or some other database work (i.e. send a POST to the webserver that goes through to the database). This way if the database goes crazy the members in the fake pool will get marked down on BIG-IP, which means you'll get alerts right away (i.e. if the BIG-IP is configured to do SNMP traps, you'll get a trap about the fake pool members going down).
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