Forum Discussion
Apr 29, 2010
Persist only specific IPs destined for a VS
I'm looking to limit persistence to specifc IPs destined for a VS and load balance everyone else with the default LB metric assigned to the Pool. I see I can only apply a mask in the standard Source ...
Michael_Yates
Nimbostratus
Apr 29, 2010It should be more efficient to do a qualifying compare and an action if it meets your criteria.
If client IP Address is in the matchclass data set, do this....
Your code is doing a variable set and then a compare.
Set hostip variable if the clients IP Address is in the matchclass data set.
Then
If the hostip is not equal to nothing / null, do this....
iRule efficiency is generally sacrificed for readability, but if this iRule has to be processed a couple of hundred times per second, it could add up to some processing latency.
I would try this. It does the compare and either applies the persistence or releases the traffic to the pool of the Virtual Server it is applied to:
when CLIENT_ACCEPTED {
if { ([matchclass [IP::remote_addr] equals $::TestDataGroup ]) } {
persist source_addr 28800
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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