Forum Discussion
iinoue_38219
Aug 29, 2011Nimbostratus
Universal Persistence for URI String
I am a newbie of iRules. My system is BIG-IP 10.2.1. I would like to loadbalance across two virtual-servers based on URI string. First, a server reply HTTP_RESPONSE with "ticke...
The_Bhattman
Aug 29, 2011Nimbostratus
Hi Innoue,
If you have 2 virtual servers but share the same IP address then yes you can share the same persistance profile and match it across the 2 virtualls.
However, when it comes to 2 separate Virtual IP addresses then I think Election HASH iRule applied to both virtuals might do the trick
Here is the code
Election Hash iRule
Compute Hash - MD5
MD5 calculation of Server + URI
Rule selects Server that scores highest
S = Current high score
N = Node being evaluated
W = Winning node
when HTTP_REQUEST timing on {
set S ""
foreach N [active_members -list ] {
if { [md5 $N [URI::query [HTTP::uri]] ticket] > $S } {
set S [md5 $N[HTTP::uri]]
set W $N
}
}
pool member [lindex $W 0] [lindex $W 1]
}
You can find more details about it on the following link
http://devcentral.f5.com/wiki/iRules.ElectionHashLoadBalancingAndPersistence.ashx
I hope this helps
Bhattman
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